P panagiotisden2 Active Member Licensed User Longtime User Mar 7, 2017 #1 updated my app in play store and i used multidex in the updated app, the next day i have some users reporting my app cant even open and the crash report is here: Code: Copy java.lang.RuntimeException: Unable to instantiate application android.support.multidex.MultiDexApplication: java.lang.ClassNotFoundException: Didn't find class "android.support.multidex.MultiDexApplication" on path: DexPathList[[zip file "/data/app/com.orionapps.testkok-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.orionapps.testkok-1, /vendor/lib, /system/lib]] at android.app.LoadedApk.makeApplication(LoadedApk.java:516) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4555) at android.app.ActivityThread.access$1500(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1402) at android.os.Handler.dispatchMessage(Handler.java:110) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:5333) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.multidex.MultiDexApplication" on path: DexPathList[[zip file "/data/app/com.orionapps.testkok-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.orionapps.testkok-1, /vendor/lib, /system/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:497) at java.lang.ClassLoader.loadClass(ClassLoader.java:457) at android.app.Instrumentation.newApplication(Instrumentation.java:975) at android.app.LoadedApk.makeApplication(LoadedApk.java:511) ... 11 more they cant even see the app's main activity it crashes instantly. i can confirm it works on many devices including mine without a problem and the crashes are all from android 4.4 users. any clue here?
updated my app in play store and i used multidex in the updated app, the next day i have some users reporting my app cant even open and the crash report is here: Code: Copy java.lang.RuntimeException: Unable to instantiate application android.support.multidex.MultiDexApplication: java.lang.ClassNotFoundException: Didn't find class "android.support.multidex.MultiDexApplication" on path: DexPathList[[zip file "/data/app/com.orionapps.testkok-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.orionapps.testkok-1, /vendor/lib, /system/lib]] at android.app.LoadedApk.makeApplication(LoadedApk.java:516) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4555) at android.app.ActivityThread.access$1500(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1402) at android.os.Handler.dispatchMessage(Handler.java:110) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:5333) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.multidex.MultiDexApplication" on path: DexPathList[[zip file "/data/app/com.orionapps.testkok-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.orionapps.testkok-1, /vendor/lib, /system/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:497) at java.lang.ClassLoader.loadClass(ClassLoader.java:457) at android.app.Instrumentation.newApplication(Instrumentation.java:975) at android.app.LoadedApk.makeApplication(LoadedApk.java:511) ... 11 more they cant even see the app's main activity it crashes instantly. i can confirm it works on many devices including mine without a problem and the crashes are all from android 4.4 users. any clue here?
MarcoRome Expert Licensed User Longtime User Mar 7, 2017 #2 Look THIS seem that multidex work without problem with Android 5 or > A big reason (on lower version android devices) of this issue is adding Play Services dependency. Avoid adding whole Play services gradle dependency. Instead of whole Play Services dependency, add only specific dependency which you going to use in your project (such as : location, maps, places etc.). Click to expand... Upvote 0
Look THIS seem that multidex work without problem with Android 5 or > A big reason (on lower version android devices) of this issue is adding Play Services dependency. Avoid adding whole Play services gradle dependency. Instead of whole Play Services dependency, add only specific dependency which you going to use in your project (such as : location, maps, places etc.). Click to expand...
P panagiotisden2 Active Member Licensed User Longtime User Mar 7, 2017 #3 yes i agree with that, it works on android 5, 6.0.1 and 7.1.1. i have tested my app in devices with android 5 and higher and it works, but the crash here is reported by android 4.4 users (the same crash and only android 4.4 devices) Upvote 0
yes i agree with that, it works on android 5, 6.0.1 and 7.1.1. i have tested my app in devices with android 5 and higher and it works, but the crash here is reported by android 4.4 users (the same crash and only android 4.4 devices)
MarcoRome Expert Licensed User Longtime User Mar 7, 2017 #4 Anyway i think that this way is the best for you: Code: Copy #ExcludeClasses: .games, .drive, .ads, .fitness, .wearable, .measurement, .cast, .auth, .nearby #ExcludeClasses: .tagmanager, .analytics, .wallet, .plus, .vision, .gcm...... Upvote 0
Anyway i think that this way is the best for you: Code: Copy #ExcludeClasses: .games, .drive, .ads, .fitness, .wearable, .measurement, .cast, .auth, .nearby #ExcludeClasses: .tagmanager, .analytics, .wallet, .plus, .vision, .gcm......
P panagiotisden2 Active Member Licensed User Longtime User Mar 7, 2017 #5 MarcoRome said: Anyway i think that this way is the best for you: Code: Copy #ExcludeClasses: .games, .drive, .ads, .fitness, .wearable, .measurement, .cast, .auth, .nearby #ExcludeClasses: .tagmanager, .analytics, .wallet, .plus, .vision, .gcm...... Click to expand... thought about it, but i dont know where to find the all the classes that can be excluded. and i am using appodeal (a lot of additional jars) so i am afraid that even if i exclude some google classes, it still wont compile without multidex Upvote 0
MarcoRome said: Anyway i think that this way is the best for you: Code: Copy #ExcludeClasses: .games, .drive, .ads, .fitness, .wearable, .measurement, .cast, .auth, .nearby #ExcludeClasses: .tagmanager, .analytics, .wallet, .plus, .vision, .gcm...... Click to expand... thought about it, but i dont know where to find the all the classes that can be excluded. and i am using appodeal (a lot of additional jars) so i am afraid that even if i exclude some google classes, it still wont compile without multidex
Erel B4X founder Staff member Licensed User Longtime User Mar 7, 2017 #6 I don't recommend you to use #ExcludeClasses. Assuming that you are using the maven repositories then it will include the correct classes anyway. Have you tested your app on an Android 4.4 device? Upvote 0
I don't recommend you to use #ExcludeClasses. Assuming that you are using the maven repositories then it will include the correct classes anyway. Have you tested your app on an Android 4.4 device?
MarcoRome Expert Licensed User Longtime User Mar 7, 2017 #7 Assuming that you are using the maven repositories then it will include the correct classes anyway. Click to expand... I did not know this. Upvote 0
Assuming that you are using the maven repositories then it will include the correct classes anyway. Click to expand... I did not know this.
MarcoRome Expert Licensed User Longtime User Mar 7, 2017 #8 Erel said: I don't recommend you to use #ExcludeClasses. Assuming that you are using the maven repositories then it will include the correct classes anyway. Have you tested your app on an Android 4.4 device? Click to expand... So it isnt longer necessary to use #ExcludeClasses ? Upvote 0
Erel said: I don't recommend you to use #ExcludeClasses. Assuming that you are using the maven repositories then it will include the correct classes anyway. Have you tested your app on an Android 4.4 device? Click to expand... So it isnt longer necessary to use #ExcludeClasses ?
DonManfred Expert Licensed User Longtime User Mar 7, 2017 #9 MarcoRome said: So it isnt longer necessary to use #ExcludeClasses ? Click to expand... Not if all libs are using maven-references. Additionally you dont need it because of #MultiDex: true Upvote 0
MarcoRome said: So it isnt longer necessary to use #ExcludeClasses ? Click to expand... Not if all libs are using maven-references. Additionally you dont need it because of #MultiDex: true
MarcoRome Expert Licensed User Longtime User Mar 7, 2017 #10 m DonManfred said: Not if all libs are using maven-references. Additionally you dont need it because of #MultiDex: true Click to expand... mmhh...good news ( i will do reading a few documentation ). Thanks Don Upvote 0
m DonManfred said: Not if all libs are using maven-references. Additionally you dont need it because of #MultiDex: true Click to expand... mmhh...good news ( i will do reading a few documentation ). Thanks Don
P panagiotisden2 Active Member Licensed User Longtime User Mar 7, 2017 #11 Erel said: I don't recommend you to use #ExcludeClasses. Assuming that you are using the maven repositories then it will include the correct classes anyway. Have you tested your app on an Android 4.4 device? Click to expand... no, i haven't i assumed it will work because multidex need android >2.3... i dont know which libraries are using maven repositories, but i get 72994 references without multidex so i cant compile it.. indeed using excludeclasses does not change anything in this number.. any possible reason for the errors? as i said im using appodeal so i have ~9 additional jars in my app plus im using #Extends: android.support.v7.app.AppCompatActivity too. Upvote 0
Erel said: I don't recommend you to use #ExcludeClasses. Assuming that you are using the maven repositories then it will include the correct classes anyway. Have you tested your app on an Android 4.4 device? Click to expand... no, i haven't i assumed it will work because multidex need android >2.3... i dont know which libraries are using maven repositories, but i get 72994 references without multidex so i cant compile it.. indeed using excludeclasses does not change anything in this number.. any possible reason for the errors? as i said im using appodeal so i have ~9 additional jars in my app plus im using #Extends: android.support.v7.app.AppCompatActivity too.
MarcoRome Expert Licensed User Longtime User Mar 7, 2017 #12 panagiotisden2 said: no, i haven't i assumed it will work because multidex need android >2.3... i dont know which libraries are using maven repositories, but i get 72994 references without multidex so i cant compile it.. indeed using excludeclasses does not change anything in this number.. any possible reason for the errors? as i said im using appodeal so i have ~9 additional jars in my app plus im using #Extends: android.support.v7.app.AppCompatActivity too. Click to expand... It is not really so.... Look THIS When running on versions prior to Android 5.0 (API level 21), using multidex is not enough to work around the linearalloc limit (issue 78035). This limit was increased in Android 4.0 (API level 14), but that did not solve it completely. And on versions lower than Android 4.0, you might reach the linearalloc limit before reaching the DEX index limit. So if you are targeting API levels lower than 14, test thoroughly on those versions of the platform, because your app might have issues at startup or when particular groups of classes are loaded. Click to expand... Upvote 0
panagiotisden2 said: no, i haven't i assumed it will work because multidex need android >2.3... i dont know which libraries are using maven repositories, but i get 72994 references without multidex so i cant compile it.. indeed using excludeclasses does not change anything in this number.. any possible reason for the errors? as i said im using appodeal so i have ~9 additional jars in my app plus im using #Extends: android.support.v7.app.AppCompatActivity too. Click to expand... It is not really so.... Look THIS When running on versions prior to Android 5.0 (API level 21), using multidex is not enough to work around the linearalloc limit (issue 78035). This limit was increased in Android 4.0 (API level 14), but that did not solve it completely. And on versions lower than Android 4.0, you might reach the linearalloc limit before reaching the DEX index limit. So if you are targeting API levels lower than 14, test thoroughly on those versions of the platform, because your app might have issues at startup or when particular groups of classes are loaded. Click to expand...
P panagiotisden2 Active Member Licensed User Longtime User Mar 7, 2017 #13 thanks marco i didn't know that.. soo is there a workaround so i dont have to use multidex? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Mar 8, 2017 #14 1. Can you send me the compiled APK to [email protected]? 2. Create a new project, add #MultiDex: True and compile it in Release mode and send me this APK as well. Upvote 0
1. Can you send me the compiled APK to [email protected]? 2. Create a new project, add #MultiDex: True and compile it in Release mode and send me this APK as well.
P panagiotisden2 Active Member Licensed User Longtime User Mar 8, 2017 #15 OK erel, you mean a completely new project or a new compiled apk of my app with multidex false? Edit- Oh sorry I haven't drink any coffee yet. Sending in a minute Last edited: Mar 8, 2017 Upvote 0
OK erel, you mean a completely new project or a new compiled apk of my app with multidex false? Edit- Oh sorry I haven't drink any coffee yet. Sending in a minute
Erel B4X founder Staff member Licensed User Longtime User Mar 8, 2017 #16 It looks like the MultiDex support library is missing from your APK. It should be added automatically when you set #MultiDex to true. Please add this code to Activity_Create and run your project: Code: Copy Dim jo As JavaObject jo.InitializeStatic("android.support.multidex.MultiDexApplication") It will throw an error is the MultiDex library is missing. Assuming that it doesn't throw an error then take the new APK and upload it to Google Play. Upvote 0
It looks like the MultiDex support library is missing from your APK. It should be added automatically when you set #MultiDex to true. Please add this code to Activity_Create and run your project: Code: Copy Dim jo As JavaObject jo.InitializeStatic("android.support.multidex.MultiDexApplication") It will throw an error is the MultiDex library is missing. Assuming that it doesn't throw an error then take the new APK and upload it to Google Play.
P panagiotisden2 Active Member Licensed User Longtime User Mar 8, 2017 #17 ok erel, i will try and let you know thank you Upvote 0
P panagiotisden2 Active Member Licensed User Longtime User Mar 9, 2017 #18 Hi erel, The solution you told me didn't fix the error, it still crashes on android 4.4 devices with the same logs. Upvote 0
Hi erel, The solution you told me didn't fix the error, it still crashes on android 4.4 devices with the same logs.
Erel B4X founder Staff member Licensed User Longtime User Mar 9, 2017 #19 Did you run your project with the code I posted (on any device)? Did it crash? Upvote 0
P panagiotisden2 Active Member Licensed User Longtime User Mar 9, 2017 #20 I run it successfully on android 6 and 7.1, tested today in a 4.4.4 device and it crashed again with the same error as before Upvote 0
I run it successfully on android 6 and 7.1, tested today in a 4.4.4 device and it crashed again with the same error as before