I use Crashlytics, which provides Maven custom URLs. I am trying to move Crashlytics code to a library.
The build.gradle library build.gradle as follows:
buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.9.+' } } repositories { mavenCentral() maven { url 'http://download.crashlytics.com/maven' } } dependencies { compile 'com.crashlytics.android:crashlytics:1.+' }
When you create this library project, everything is going well. However, when I add the library to a dependency on another project, gradle synchronization only happens when I add my own maven URL to my build.gradle . Otherwise, the following message appears:
Error:A problem occurred configuring project ':MyApp'. > Could not resolve all dependencies for configuration ':MyApp:_debugCompile'. > Could not find any version that matches com.crashlytics.android:crashlytics:1.+. Required by: my-app:MyApp:unspecified > my-app:MyLibrary:unspecified
Why do I need to add the maven { url 'http://download.crashlytics.com/maven' } project maven { url 'http://download.crashlytics.com/maven' } to the MyApp project? Is there a better solution?
source share