在我的Android應用程序項目中,我想使用https://github.com/Bearded-Hen/Android-Bootstrap/tree/master/AndroidBootstrap作爲依賴項(我使用Android Studio 0.8.8)。Android應用程序與Android庫項目作爲外部模塊
這是我settings.gradle
include ':gui', ':client', ':Android-Bootstrap'
project(':Android-Bootstrap').projectDir=new File('/abs/path/to/Android-Bootstrap/AndroidBootstrap')
而且我的GUI /的build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.13.3'
}
}
apply plugin: 'com.android.application'
repositories {
mavenCentral()
}
android {
compileSdkVersion 19
buildToolsVersion "19.1"
defaultConfig {
minSdkVersion 10
targetSdkVersion 19
}
...
skipped
...
}
dependencies {
...skipped...
compile 'com.android.support:appcompat-v7:19.1.0'
...skipped...
compile project(':client')
compile project(':AndroidBootstrap')
}
當我搖籃同步,我得到::
Error:(1, 0) Plugin with id 'android-library' not found.
如果我刪除
project(':Android-Bootstrap').projectDir=new File('/abs/path/to/Android-Bootstrap/AndroidBootstrap')
我得到
Error:(44, 0) Project with path ':AndroidBootstrap' could not be found in project ':gui'.
如果我改變https://github.com/Bearded-Hen/Android-Bootstrap/blob/master/AndroidBootstrap/build.gradle與
apply plugin: 'com.android.library'
我得到
Error:(1, 0) Plugin with id 'com.android.library' not found.
如果我加入https://github.com/Bearded-Hen/Android-Bootstrap/blob/master/AndroidBootstrap/build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.13.3'
}
}
我得到
Error:(44, 0) Project with path ':AndroidBootstrap' could not be found in project ':gui'.
如何解決?我希望這個模塊是外部的,不需要導入並複製到主項目中。爲什麼修復gradle插件依賴導致找不到路徑問題?
嘗試'settings.gradle'with include':AndroidBootstrap' – 2014-10-31 16:22:41