我发现相同的问题Duplicate。但是我没有maven依赖。我有子项目依赖项。
我只想为一种口味使用一个项目依赖项。这是我的build.gradle
dependencies {
secureCompile project(':relatedProjects:gd')
}
android {
compileSdkVersion "Google Inc.:Google APIs:19"
buildToolsVersion "18.1.1"
productFlavors {
google {}
secure {
packageName "com.some_secure.package"
}
}
}
这是构建命令的控制台
./gradlew clean assembleDebug
FAILURE: Build failed with an exception.
* Where:
Build file '/home/kulik/project/Notate/notateolearis/notateandroid/build.gradle' line: 27
* What went wrong:
A problem occurred evaluating project ':someproject'.
> Could not find method secureCompile() for arguments [project ':relatedProjects:gd'] on project ':someproject'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 15.957 secs
解决方案已建立。风味应该在使用前声明,因此正确的构建标准是:
android {
productFlavors {
google {}
secure {
packageName "com.some_secure.package"
}
}
dependencies {
secureCompile project(':relatedProjects:gd')
}
compileSdkVersion "Google Inc.:Google APIs:19"
buildToolsVersion "18.1.1"
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句