Hi guys,
What could be the correct procedure of building for Android, using Gradle, Multidex and Unity 2017.3?
My app builds and runs fine on iOS but I can’t get it to run on Android no matter what I do.
I’ve spent more than 2 days on this, without any positive results.
Using Appodeal and Cross Native, I’m over the 65K Dex limit, so I have to use Multidex. So I’ve made my custom .gradle file which has the multidex attribute set to true.
But I still get this (edited to save space – some lines deleted but the idea is clear):
E/Unity ( 6280): AndroidJavaException: java.lang.NoClassDefFoundError: com.voxelbusters.nativeplugins.features.cloudservices.serviceprovider.google.GooglePlayCloudService
E/Unity ( 6280): java.lang.NoClassDefFoundError: com.voxelbusters.nativeplugins.features.cloudservices.serviceprovider.google.GooglePlayCloudService
AndroidJavaException: java.lang.ClassNotFoundException: com.voxelbusters.nativeplugins.features.gameservices.GameServicesHandler
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.voxelbusters.nativeplugins.features.gameservices.GameServicesHandler" on path: DexPathList[[zip file "/data/app/com.bonjackpot.impasto-1/base.apk"],nativeLibraryDirectories=[/data/app/com.bonjackpot.impasto-1/lib/arm, /vendor/lib, /system/li
AndroidJavaException: java.lang.ClassNotFoundException: com.voxelbusters.nativeplugins.features.medialibrary.MediaLibraryHandler
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.voxelbusters.nativeplugins.features.medialibrary.MediaLibraryHandler" on path: DexPathList[[zip file "/data/app/com.bonjackpot.impasto-1/base.apk"],nativeLibraryDirectories=[/data/app/com.bonjackpot.impasto-1/lib/arm, /vendor/lib, /system/li
E/Unity ( 6280): AndroidJavaException: java.lang.ClassNotFoundException: com.voxelbusters.nativeplugins.features.reachability.NetworkReachabilityHandler
E/Unity ( 6280): java.lang.ClassNotFoundException: com.voxelbusters.nativeplugins.features.reachability.NetworkReachabilityHandler
E/Unity ( 6280): AndroidJavaException: java.lang.ClassNotFoundException: com.voxelbusters.nativeplugins.features.webview.WebViewHandler
E/Unity ( 6280): java.lang.ClassNotFoundException: com.voxelbusters.nativeplugins.features.webview.WebViewHandler
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/gson/JsonObject;
E/AndroidRuntime( 6280): at com.voxelbusters.nativeplugins.features.billing.core.datatypes.BillingProduct.getJsonObject(BillingProduct.java:20)
There should be an option MultiDexKeepFile but it just doesn’t do anything (it is seems to be ignored as there are no errors during the .apk assemly even if I delete the file or put some garbage there)
I would like to ask an official Unity team member about the correct usage of MultiDexKeepFile with Unity and if that’s not an option, how else my issue could be solved? Thanks!