【发布时间】:2014-12-28 00:33:38
【问题描述】:
在我的 Android 应用程序项目中,我想使用 https://github.com/Bearded-Hen/Android-Bootstrap/tree/master/AndroidBootstrap 作为依赖项(我使用 Android Studio 0.8.8)。
这是我的 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 插件依赖会导致找不到路径的问题?
【问题讨论】:
-
尝试使用包含 ':AndroidBootstrap' 的 'settings.gradle'
标签: android gradle android-studio android-gradle-plugin android-library