I'm trying to compile my project using "Build App Bundle (Google Play)" for the first time. However I am getting an error while merging dex archives.
I believe it is due to some of my plugins are using different version of some amazon module
first error printed in the console:
D8: Program type already present: com.amazon.ags.BuildConfig
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
When I search for com.amazon.ags.BuildConfig I find nothing. (But my assumption might be wrong)
I have tried to enable multiDex by adding the mainTemplate.gradle to my project
defaultConfig {
minSdkVersion **MINSDKVERSION**
targetSdkVersion **TARGETSDKVERSION**
applicationId '**APPLICATIONID**'
multiDexEnabled true
ndk {
abiFilters **ABIFILTERS**
}
versionCode **VERSIONCODE**
versionName '**VERSIONNAME**'
}
But I'm still getting the same error, and I have no chance of knowing whether the new gradle file is actually included when building or if unity simply ignores it.
This is the error that pops up when the build fails:
java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
C:\Users\path-to-project\unity\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\57,
C:\Users\path-to-project\unity\Temp\gradleOut\build\intermediates\transforms\externalLibsDexMerger\release\0,
C:\Users\path-to-project\unity\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\52.jar,
C:\Users\path-to-project\unity\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\54.jar
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
I see a lot of people lately solving similar error by removing unity ads and/or google ads plugins and re-enable them, I never used google ads, but I have tried to remove unity ads plugin, still no cigar, I have also tried with different version of the unity ads plugin both the one from asset store and the "built in extension" still no dice.
I have been on a discussion with some guys here but I have tried the solutions each one of them have provided without luck.
Any suggestions on how I can find out which plugin is causing this and how to fix it ?
