出于某种原因,travis build很难解决依赖关系。
A problem occurred configuring project ':app'.
Could not resolve all dependencies for configuration ':app:_debugApk'.
A problem occurred configuring project ':mortar'.
Could not resolve all dependencies for configuration ':mortar:classpath'.
Cannot resolve external dependency com.android.tools.build:gradle:2.2.2 because no repositories are defined.
Required by:
mortar-evolution-stone:mortar:unspecified
答案 0 :(得分:2)
无法解析外部依赖项com.android.tools.build:gradle:2.2.2,因为没有定义存储库
在mortar/build.gradle
你没有任何关系。
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
}
}
但是,你不应该那样......你的/build.gradle
可以设置它。
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
// *** Add this *** //
buildscript {
repositories {
jcenter()
}
}
repositories {
jcenter()
}
}
实际上,您的代码库中根本不需要mortar
。
app/build.gradle
dependencies {
...
// compile project(':mortar') // ** Remove this ** //
compile 'com.squareup.mortar:mortar:(latest version)'
}