Issue
I'm trying out APK Tests in Modules and went through the whole setup process. It seams that Gradle has problem finding dependencies of an app module if they are fetched from repositories other then jCenter.
One of the dependencies is MPAndroidChart located using jitpack:
repositories {
maven { url "https://jitpack.io" }
}
But plugin: 'com.android.test'
seems to ignore this clause: it's not propagated from app
module.
Reported error:
Error:A problem occurred configuring project ':test'.
> Could not resolve all dependencies for configuration ':test:_debugCompile'.
> Could not find com.github.PhilJay:MPAndroidChart:v2.0.9.
Searched in the following locations:
https://jcenter.bintray.com/com/github/PhilJay/MPAndroidChart/v2.0.9/MPAndroidChart-v2.0.9.pom
https://jcenter.bintray.com/com/github/PhilJay/MPAndroidChart/v2.0.9/MPAndroidChart-v2.0.9.jar
file:/Users/me/Library/Android/sdk/extras/android/m2repository/com/github/PhilJay/MPAndroidChart/v2.0.9/MPAndroidChart-v2.0.9.pom
file:/Users/me/Library/Android/sdk/extras/android/m2repository/com/github/PhilJay/MPAndroidChart/v2.0.9/MPAndroidChart-v2.0.9.jar
file:/Users/me/Library/Android/sdk/extras/google/m2repository/com/github/PhilJay/MPAndroidChart/v2.0.9/MPAndroidChart-v2.0.9.pom
file:/Users/me/Library/Android/sdk/extras/google/m2repository/com/github/PhilJay/MPAndroidChart/v2.0.9/MPAndroidChart-v2.0.9.jar
Required by:
company-android-app:test:unspecified > company-android-app:app:unspecified
Solution
Looks like the problem can be omitted by explicitly adding the repository to the test
module:
repositories {
maven { url "https://jitpack.io" }
mavenCentral()
}
Tested with buildToolsVersion '23.0.0rc3'
and classpath 'com.android.tools.build:gradle:1.3.0'
Answered By - atok
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.