In connection with this post, someone has a couple of build.gradle files that demonstrate the basic setup for linking to Crashlytics from the Android library project.
I get the following error, even if I followed the recommendation provided through the message mentioned above.
This is my gradle.build application file.
buildscript { repositories { mavenCentral() maven { url 'http://download.crashlytics.com/maven' } } dependencies { classpath 'com.android.tools.build:gradle:0.10.+' classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+' } } apply plugin: 'android' apply plugin: 'crashlytics' repositories { mavenCentral() maven { url 'http://download.crashlytics.com/maven' } } dependencies { compile project(':Common.Logger') compile project(':Common.ProtocolBuffer') compile project(':Common.Utils') compile 'com.google.android.gms:play-services:+' compile 'com.android.support:support-v4:+' compile 'com.crashlytics.android:crashlytics:1.+' androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.1' androidTestCompile 'junit:junit:4.11' } android { compileSdkVersion 19 buildToolsVersion '19.0.3' buildTypes { debug { buildConfigField "boolean", "USE_LOGCAT", "true" buildConfigField "boolean", "USE_CRASHLYTICS", "false" ext.enableCrashlytics=false } release { runProguard true debuggable false proguardFile getDefaultProguardFile('proguard-android-optimize.txt') buildConfigField "boolean", "USE_LOGCAT", "false" buildConfigField "boolean", "USE_CRASHLYTICS", "true" ext.enableCrashlytics=true } } sourceSets { packagingOptions { exclude 'LICENSE.txt' } lintOptions { abortOnError false } } }
This is my current build.gradle library file.
buildscript { repositories { mavenCentral() maven { url 'http://download.crashlytics.com/maven' } } dependencies { classpath 'com.android.tools.build:gradle:0.10.+' classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+' } } repositories { mavenCentral() maven { url 'http://download.crashlytics.com/maven' } } dependencies { compile 'com.crashlytics.android:crashlytics:1.+' } apply plugin: 'android-library' android { compileSdkVersion 19 buildToolsVersion '19.0.3' buildTypes { debug { buildConfigField "boolean", "USE_LOGCAT", "true" buildConfigField "boolean", "USE_CRASHLYTICS", "false" ext.enableCrashlytics=false } release { buildConfigField "boolean", "USE_LOGCAT", "false" buildConfigField "boolean", "USE_CRASHLYTICS", "true" ext.enableCrashlytics=true } } sourceSets { lintOptions { abortOnError false } } }
Some time ago Crashlytics told me to just use the ext.enableCrashlytics flag in the buildType file.
The following is the current gradle error that occurs using gradle assembly files.
Error:A problem occurred configuring root project 'ManageMyVMail.Android'. > A problem occurred configuring project ':Common.ProtocolBuffer'. > Could not resolve all dependencies for configuration ':Common.ProtocolBuffer:_debugCompile'. > Could not find any version that matches com.crashlytics.android:crashlytics:1.+. Required by: ManageMyVMail.Android:Common.ProtocolBuffer:unspecified > ManageMyVMail.Android:Common.Logger:unspecified
As a side issue, I need to create the same set of buildConfigField values ββin both files if I want to use them from both projects after I pass the current gradle build error. I am new to gradle and Android Studio, but the Intertron search just didn't give an answer.
Thanks in advance.