Android Question [Solved] Error Multidex: B4A 9.30 + AndroidX SDK + Android 4.2 and 4.4

asales

Expert
Licensed User
Longtime User
I tested the new version of B4A in Android 7, 8 and 9, from beta 1 to final release.
Now I went compile the app to Android 4.2 and 4.4 and I get the errors below (in unfiltered logs).
B4X:
FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to instantiate application androidx.multidex.MultiDexApplication: java.lang.ClassNotFoundException: Didn't find class "androidx.multidex.MultiDexApplication" on path: /data/app/br.com.myprofiles-2.apk
    at android.app.LoadedApk.makeApplication(LoadedApk.java:504)
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4525)
    at android.app.ActivityThread.access$1400(ActivityThread.java:150)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1340)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:5279)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
    at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.multidex.MultiDexApplication" on path: /data/app/br.com.myprofiles-2.apk
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
    at android.app.Instrumentation.newApplication(Instrumentation.java:985)
    at android.app.LoadedApk.makeApplication(LoadedApk.java:499)
    ... 11 more
B4X:
FATAL EXCEPTION: main
Process: br.com.myprofiles, PID: 28048
java.lang.RuntimeException: Unable to instantiate application androidx.multidex.MultiDexApplication: java.lang.ClassNotFoundException: Didn't find class "androidx.multidex.MultiDexApplication" on path: DexPathList[[zip file "/data/app/br.com.myprofiles-2.apk"],nativeLibraryDirectories=[/data/app-lib/br.com.myprofiles-2, /vendor/lib, /system/lib]]
    at android.app.LoadedApk.makeApplication(LoadedApk.java:544)
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4513)
    at android.app.ActivityThread.access$1500(ActivityThread.java:145)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1325)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:136)
    at android.app.ActivityThread.main(ActivityThread.java:5214)
    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:814)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:630)
    at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.multidex.MultiDexApplication" on path: DexPathList[[zip file "/data/app/br.com.myprofiles-2.apk"],nativeLibraryDirectories=[/data/app-lib/br.com.myprofiles-2, /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:539)
    ... 11 more
  Force finishing activity br.com.myprofiles/.main
The problem is only with AndroidX SDK.

I tried to used the line of this post in manifest, without success:
https://www.b4x.com/android/forum/t...t-work-with-multidex-true.107232/#post-670553

How I can fix it?
Thanks in advance for any tips.
 

Scantech

Well-Known Member
Licensed User
Longtime User
I think the Users should be informed about this issue. I am certain many apps are using Multi Dex and i am one of them. We should get an updated B4A version with updated Dexer file. Just my opinion.
 
Upvote 0
Top