Reputation: 53600
My project was working and everything was fine but have no idea what happened suddenly that I'm getting error when I want to build my project. This is Gradle output:
/Users/admin/Desktop/android/MY-Project/build/intermediates/res/project/debug/values/values.xml:265: error: Resource entry com.crashlytics.android.build_id is already defined.
/Users/admin/Desktop/android/MY-Project/build/intermediates/res/project/debug/values/com_crashlytics_build_id.xml:9: Originally defined here.
Since both of these files are auto generated I cannot do anything :(
./gradlew clean assembleDebug
but nothing happened.I have this classpath in my build script but as mentioned it was working...
dependencies {
classpath 'com.android.tools.build:gradle:1.0.1'
classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
}
Any suggestion would be appreciated. Thanks.
Upvotes: 27
Views: 13819
Reputation: 756
remove this also besides fabric
crashlytics {
enableNdk true
}
Upvotes: 0
Reputation: 411
I had the same problem.
My mistake is I add fabric plugin and firebaseCrashlytics plugin on my gradle. (reason : plugin build id duplicate crash)
You must fix select A and B plugin.
A : apply plugin: 'com.google.firebase.crashlytics
B : apply plugin: 'io.fabric
Upvotes: 19
Reputation: 1941
I have an app of two flavors: Debug and Release, with two manifests and two distinct packages com.myapp.release and com.myapp.debug for each flavor, respectively.
After migration from Fabric.io to Firebase Crashalytics, a Gradle warning
appeared about duplicate com_crashlytics_build_id.xml
:
/home/.../app/build/generated/fabric/res/flavor1/debug/values/com_crashlytics_build_id.xml [string/com.crashlytics.android.build_id] /home/.../app/build/generated/crashlytics/res/flavor2/debug/values/com_crashlytics_build_id.xml: Error: Duplicate resources
Fix:
in build.gradle
remove
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
remove
apply plugin: 'io.fabric'
Upvotes: 38
Reputation: 19039
io.fabric.tools:gradle
versionsDifferent io.fabric.tools:gradle
versions in the app and library caused this for me.
I'd the following in the app's build.gradle
:
classpath 'io.fabric.tools:gradle:1.19.2'
And the following in the library's build.gradle
:
classpath 'io.fabric.tools:gradle:1+'
I changed both to following to fix it:
classpath 'io.fabric.tools:gradle:1.19.2'
PS: We need better error messages. As programmers we waste of lot of time when the error messages are not only bad, but as in this case, downright misleading.
Upvotes: 8
Reputation: 2670
I had the same problem, one of my dependencies had mistakenly added the com.crashlytics.android.build_id via craslytics's auto genereted xml file.
It was a library project and deleting :
library/src/main/assets/crashlytics-build.properties
library/src/main/res/values/com_crashlytics_export_strings.xml
fixed it for me.
Upvotes: 14