I would like to configure Fabric dependencies for Unity Android build using gradle. I'm now exporting the project and using Android Studio to get rid of the errors and then prepare a custom working "mainTemplate.gradle" so I can build directly from Unity 5.6. Here are the configured dependencies as Unity suggested:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// other dependencies
compile project(':answers')
compile project(':beta')
compile project(':crashlytics')
compile project(':crashlytics-wrapper')
compile project(':fabric')
compile project(':fabric-init')
}
Each of the Fabric folders is treated as a library that has its own gradle config. Here are the errors I'm getting (due to a file used in same namespace of two "libraries"):
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lio/fabric/unity/crashlytics/android/BuildConfig;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lio/fabric/unity/android/BuildConfig;
I tried adding the following but it did not work:
android {
dexOptions {
preDexLibraries = false
}
I also tried without success:
task androidReleaseJar(type: Jar, dependsOn: assembleRelease) {
from "$buildDir/intermediates/classes/release/"
exclude '**/BuildConfig.class'
}
android { packageBuildConfig = false
– Kokaras