I’m building apk for Android using Gradle, because of a lot of plugins and dex errors. Locally everything works fine. Even other similar projects builds fine on Cloud Build. On my current project i get 2 errors:
One with Facebook SDK:
11316: [Unity] error CS1704: An assembly with the same name `Facebook.Unity.Settings’ has already been imported. Consider removing one of the references or sign the assembly
I found out this topic: `Facebook.Unity.Settings' has already been imported error but fix doesn’t work. Strange thing is that it works other projects.
Another one is about gradle:
18241: [Unity] FAILURE: Build failed with an exception.
18242: [Unity] * What went wrong:
18243: [Unity] Execution failed for task ‘:transformClassesAndResourcesWithProguardForRelease’.
18244: [Unity] > java.io.IOException: Please correct the above warnings first.
18211: [Unity] Note: there were 11 duplicate class definitions.
18212: [Unity] (ProGuard Manual: Troubleshooting | Guardsquare)
18213: [Unity] Warning: com.appsflyer.GcmInstanceIdListener: can’t find superclass or interface com.google.android.gms.iid.InstanceIDListenerService
…
18222: [Unity] Warning: com.unity.purchasing.googleplay.GooglePlayPurchasing$6: can’t find referenced class com.google.vr.ndk.base.DaydreamApi18227: [Unity] Warning: com.unity.purchasing.googleplay.IabHelper$2$1: can’t find referenced class com.google.vr.ndk.base.DaydreamApi
18228: [Unity] Warning: com.unity.purchasing.googleplay.IabHelper$2$1: can’t find referenced class com.google.vr.ndk.base.DaydreamApi
18232: [Unity] Warning: there were 18 unresolved references to classes or interfaces.
18233: [Unity] You may need to add missing library jars or update their versions.
18234: [Unity] If your code works fine without the missing classes, you can suppress
18235: [Unity] the warnings with ‘-dontwarn’ options.
18755: [Unity] Note: there were 3 references to unknown classes.
18758: [Unity] Note: there were 50 unkept descriptor classes in kept class members.
18762: [Unity] Note: there were 29 library classes explicitly being kept.
18765: [Unity] Note: there were 17 unresolved dynamic references to classes or interfaces.
18768: [Unity] Note: there were 1 class casts of dynamically created class instances.
18772: [Unity] Note: there were 25 accesses to class members by means of introspection.
18776: [Unity] Warning: Exception while processing task java.io.IOException: Please correct the above warnings first.
18777: [Unity] :transformClassesAndResourcesWithProguardForRelease FAILED
18778: [Unity] BUILD FAILED
There is an issue for one of them in Issue Tracker (Unity Issue Tracker - [Gradle][Proguard] Build fails giving confusing error about 11 duplicate class definitions).
Do you have any idea how to workaround it? I have no idea how to use proguard and where should I put it’s rules.