여러 개의 Android 앱 및 라이브러리가 포함될 gradle로 다중 프로젝트 빌드가 있습니다. 프로젝트 구조의중첩 된 프로젝트에서 classpath 종속성이 해결되지 않았습니다.
샘플 :
root (Project Root)
| android
| module1 (Android Application)
| module2 (Android Library)
| ios (in the future)
나는 일부 하위 프로젝트에 특정 Gradle을 플러그인을 적용 할. Gradle을 안드로이드 Gradle을 발견 할 수 없다는 :android:module1 -> build.gradle -> apply plugin: 'com.android.application'
및 :android:module2 -> build.gradle -> apply plugin: 'com.android.library'
문제가 : (예에만 로이드 서브 프로젝트에 로이드 Gradle을 플러그인으로) 그러므로 I는 :android -> build.gradle
클래스 경로 의존성 두 로이드 서브 프로젝트에 플러그인 선언 첨가 노력 :root -> build.gradle
또는 :android:moduleX -> build.gradle
모든 클래스 경로 종속성을 정의 할 때 예상대로 때문에 :; 플러그인 (2.2.1 안드로이드 Gradle을 플러그인 버전 Gradle을 버전 3.1) 또한
Error:(1, 1) A problem occurred evaluating project ':Shoppr:presentation'. Plugin with id 'com.android.application' not found.
그것은 다른 질문에 같은 버전의 문제가 아니다 .
: 루트 -> build.gradle
allprojects {
repositories {
mavenCentral()
jcenter()
}
}
: 안드로이드 -> build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.1' <-- Should only be applied for android project
}
}
: 안드로이드 : 모듈 1 -> build.gradle
apply plugin: 'com.android.application' --> Plugin with id 'com.android.application' not found.
: 안드로이드 : module2 -> build.gradle
apply plugin: 'com.android.library'
감사합니다. 필자는 hte 모듈 의존성을 세부적으로 제어하기 위해 프로젝트를 분리했다. 원래 문제를 해결하지는 못하더라도 답변을 수락 한 것으로 표시하겠습니다. – chris115379