루트 프로젝트 'myproject'에서 경로가 ': mypath'인 프로젝트를 찾을 수 없습니다.
Eclipse에서 android studio 0.5.8 로 마이그레이션 했습니다. 내 프로젝트를 android studio로 가져온 후 오류가 발생했습니다.Project with path ':progressfragment' could not be found in root project 'project_name'.
프로젝트 구조 :
립
완전한 구조 (편집 2) :
Gradle.build :
apply plugin: 'android'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile project(':progressfragment')
compile project(':viewpagerindicatorlibrary')
compile project(':ZBarScannerActivity')
compile project(':google-play-services_lib')
compile project(':SwitchCompatLibrary')
compile project(':actionbarsherlock')
compile project(':librarymultichoice')
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.9.+'
}
}
android {
compileSdkVersion 14
buildToolsVersion "19.0.1"
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}
compile project("xy")
의존성 만으로는 충분하지 않습니다 . 모든 모듈을 포함하도록 루트 프로젝트를 구성해야합니다 (또는 하위 프로젝트라고 부르지 만 여기에서는 올바른 단어가 아닐 수 있음).
크리에이트 settings.gradle 프로젝트의 루트에 파일이 추가 :
include ':progressfragment'
그 파일에. 그런 다음 Gradle을 동기화하면 작동합니다.
Also one interesting side note: If you add ':unexistingProject' in settings.gradle (project that you haven't created yet), Gradle will create folder for this project after sync (at least in Android studio this is how it behaves). So, to avoid errors with settings.gradle when you create project from existing files, first add that line to file, sync and then put existing code in created folder. Unwanted behavior arising from this might be that if you delete the project folder and then sync folder will come back empty because Gradle sync recreated it since it is still listed in settings.gradle.
이 답변이 비슷한 오류에 도움이 될 수 있습니다. 하위 프로젝트를 삭제 한 후 비슷한 오류가 발생 하고 Gradle Scripts 아래의 build.gradle (종속성)에서 " compile project (path : ': MySubProject', configuration : 'android-endpoints') "를 제거했습니다.
'programing' 카테고리의 다른 글
파일에서 Unix 권한 마스크를 어떻게 얻을 수 있습니까? (0) | 2021.01.17 |
---|---|
사용할 GIT 선택 개인 키 (0) | 2021.01.17 |
PHP에서 STDOUT을 파일로 리디렉션하는 방법은 무엇입니까? (0) | 2021.01.17 |
파이썬 : 비어 있지 않은 디렉토리 삭제 (0) | 2021.01.17 |
Python으로 머신의 외부 IP 주소 가져 오기 (0) | 2021.01.17 |