在我的安卓应用程序项目中,我想使用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')
}当我gradle sync时,我得到::
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插件依赖导致path not found问题?
发布于 2014-11-01 00:38:01
在settings.gradle中进行如下修复:
include ':gui', ':client', ':AndroidBootstrap'
project(':AndroidBootstrap').projectDir=new File('/abs/path/to/Android-Bootstrap/AndroidBootstrap')注意,Android-Bootstrap被替换为AndroidBootstrap (而不是dash)
在根build.gradle (./build.gradle)中
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.13.3'
}
}它将覆盖(设置) AndroidBootstrap中的buildscript依赖关系。
不需要在AndroidBootstrap本身中进行更改。
https://stackoverflow.com/questions/26678904
复制相似问题