Nb195d App crashing on Android 4

I have issue with the compiled apk on version nb195d.
TestApp.aia (1.1 KB)
This is blank app with just 1 label on screen
App crashing on Prestigio MultiPad 7.0 Ultra + (PMP3570C) Android 4.0.4 and Mystery MID-783G Android 4.2.2. Works on Android 11

Error
I/ActivityManager(  145): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=appinventor.ai_grimmy.TestApp/.Screen1} from pid 301
D/ViewRootImpl(  145): pckname = appinventor.ai_grimmy.TestApp
I/ActivityManager(  145): Start proc appinventor.ai_grimmy.TestApp for activity appinventor.ai_grimmy.TestApp/.Screen1: pid=1451 uid=10049 gids={3003}
D/OpenGLRenderer(  301): Flushing caches (mode 1)
D/OpenGLRenderer(  301): Flushing caches (mode 0)
D/dalvikvm(   78): GC_EXPLICIT freed 38K, 7% free 5657K/6019K, paused 2ms+10ms
D/dalvikvm(   78): GC_EXPLICIT freed <1K, 7% free 5657K/6019K, paused 2ms+2ms
D/AndroidRuntime( 1451): Shutting down VM
W/dalvikvm( 1451): threadid=1: thread exiting with uncaught exception (group=0x409ed1f8)
E/AndroidRuntime( 1451): FATAL EXCEPTION: main
E/AndroidRuntime( 1451): java.lang.RuntimeException: Unable to instantiate application com.google.appinventor.components.runtime.multidex.MultiDexApplication: java.lang.ClassNotFoundException: com.google.appinventor.components.runtime.multidex.MultiDexApplication
E/AndroidRuntime( 1451):        at android.app.LoadedApk.makeApplication(LoadedApk.java:482)
E/AndroidRuntime( 1451):        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3938)
E/AndroidRuntime( 1451):        at android.app.ActivityThread.access$1300(ActivityThread.java:123)
E/AndroidRuntime( 1451):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1185)
E/AndroidRuntime( 1451):        at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 1451):        at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 1451):        at android.app.ActivityThread.main(ActivityThread.java:4424)
E/AndroidRuntime( 1451):        at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 1451):        at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 1451):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
E/AndroidRuntime( 1451):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
E/AndroidRuntime( 1451):        at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 1451): Caused by: java.lang.ClassNotFoundException: com.google.appinventor.components.runtime.multidex.MultiDexApplication
E/AndroidRuntime( 1451):        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
E/AndroidRuntime( 1451):        at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
E/AndroidRuntime( 1451):        at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
E/AndroidRuntime( 1451):        at android.app.Instrumentation.newApplication(Instrumentation.java:942)
E/AndroidRuntime( 1451):        at android.app.LoadedApk.makeApplication(LoadedApk.java:477)
E/AndroidRuntime( 1451):        ... 11 more
W/ActivityManager(  145):   Force finishing activity appinventor.ai_grimmy.TestApp/.Screen1

When I compile the same app on https://code-appinventor-mit-edu.ezproxy.canberra.edu.au/ (Built: November 28, 2023, Version: code46), it works without any issues.
Additionally, another app compiled January 18, 2024, 22:08 GMT+2 (probably nb195a) also works without crashing on these devices. (When i compile it on nb195d it crashes with same error)

Recently when I was doing my app's compatibility test, I found that my app(compiled and created on code.appinventor.mit.edu variant) is crashing at launch(It only shows a dark background) on older versions of android, tested android versions are android 4.4 KRT16M (ARM Nexus 5) and android 4.0.4 (X86 Android Studio emulator, with google), it seems that both versions of android reports the same error in common like these:

02-03 09:52:31.366  2663  2663 E AndroidRuntime: FATAL EXCEPTION: main
02-03 09:52:33.896  2676  2676 E AndroidRuntime: java.lang.RuntimeException: Unable to instantiate application com.google.appinventor.components.runtime.multidex.MultiDexApplication: java.lang.ClassNotFoundException: com.google.appinventor.components.runtime.multidex.MultiDexApplication

Edit:Partial logcat output (./adb.exe logcat, Old Microsoft Powershell used)

I/ActivityManager( 1242): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=appinventor.ai_onethatdreams3.Kobusi2/.Screen1 bnds=[360,103][480,253]} from pid 1988
D/gralloc_ranchu( 1145): gralloc_alloc: Creating ashmem region of size 1536000
I/ActivityManager( 1242): Start proc appinventor.ai_onethatdreams3.Kobusi2 for activity appinventor.ai_onethatdreams3.Kobusi2/.Screen1: pid=4827 uid=10044 gids={3003, 1015}
W/NetworkManagementSocketTagger( 1242): setKernelCountSet(10044, 1) failed with errno -2
D/AndroidRuntime( 4827): Shutting down VM
W/dalvikvm( 4827): threadid=1: thread exiting with uncaught exception (group=0xb133f180)
D/EGL_emulation( 1988): eglMakeCurrent: 0x8c586a8: ver 2 0
D/OpenGLRenderer( 1988): Flushing caches (mode 1)
E/AndroidRuntime( 4827): FATAL EXCEPTION: main
E/AndroidRuntime( 4827): java.lang.RuntimeException: Unable to instantiate application com.google.appinventor.components.runtime.multidex.MultiDexApplication: java.lang.ClassNotFoundException: com.google.appinventor.components.runtime.multidex.MultiDexApplication
E/AndroidRuntime( 4827):        at android.app.LoadedApk.makeApplication(LoadedApk.java:482)
E/AndroidRuntime( 4827):        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3938)
E/AndroidRuntime( 4827):        at android.app.ActivityThread.access$1300(ActivityThread.java:123)
E/AndroidRuntime( 4827):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1185)
E/AndroidRuntime( 4827):        at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 4827):        at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 4827):        at android.app.ActivityThread.main(ActivityThread.java:4424)
E/AndroidRuntime( 4827):        at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 4827):        at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 4827):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
E/AndroidRuntime( 4827):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
E/AndroidRuntime( 4827):        at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 4827): Caused by: java.lang.ClassNotFoundException: com.google.appinventor.components.runtime.multidex.MultiDexApplication
E/AndroidRuntime( 4827):        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
E/AndroidRuntime( 4827):        at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
E/AndroidRuntime( 4827):        at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
E/AndroidRuntime( 4827):        at android.app.Instrumentation.newApplication(Instrumentation.java:942)
E/AndroidRuntime( 4827):        at android.app.LoadedApk.makeApplication(LoadedApk.java:477)
E/AndroidRuntime( 4827):        ... 11 more
W/ActivityManager( 1242):   Force finishing activity appinventor.ai_onethatdreams3.Kobusi2/.Screen1
D/gralloc_ranchu( 1145): gralloc_alloc: Creating ashmem region of size 258048
D/EGL_emulation( 1988): eglMakeCurrent: 0x8c586a8: ver 2 0
I/Process ( 1242): Sending signal. PID: 4827 SIG: 3
I/dalvikvm( 4827): threadid=3: reacting to signal 3
I/dalvikvm( 4827): Wrote stack traces to '/data/anr/traces.txt'
I/Process ( 1242): Sending signal. PID: 4827 SIG: 3
I/dalvikvm( 4827): threadid=3: reacting to signal 3
W/ActivityManager( 1242): Activity pause timeout for ActivityRecord{b1d56de8 appinventor.ai_onethatdreams3.Kobusi2/.Screen1}
I/dalvikvm( 4827): Wrote stack traces to '/data/anr/traces.txt'
W/NetworkManagementSocketTagger( 1242): setKernelCountSet(10044, 0) failed with errno -2
D/gralloc_ranchu( 1145): gralloc_alloc: Creating ashmem region of size 258048
W/ActivityManager( 1242): Activity destroy timeout for ActivityRecord{b1fc1da8 appinventor.ai_onethatdreams3.Kobusi2/.Screen1}

Built: January 31 2024 Version: code47
Use Companion: Use Companion: 2.69 or 2.69u
I've checked some of my extensions and removed some unused extensions, and I've even tried to remove the recently added extensions which didn't installed in previous working version on android 2.3, but it didn't help, my app still force closes when it launches, could anybody help me to solve this compatibility issue?
Attachments section:


Both of my AIA file and APK file will be uploaded due to size limit on this site. Link for folder containing both of those files:Here
Bugreport TXT file obtained from virtual machine:
bugreport.txt (2.9 MB)
*Bugreport TXT file obtained from my physical machine will not be shared here due to privacy.
Thanks.
*Update: This problem only occurs on android 5.0's preview version and below, starting from android 5.0(Final release), the app no longer crashes.

I believe it's the affect of recent Java 11 upgrades introduced 195b/c onwards. (Considering this problem was reported 3 days later after the new updates published).

Probably, my guess is that older Android versions are not able to detect application classes because of higher dex class versions?

If so, would that be the unannounced end of support for Android 4 devices? @ewpatton


Also how does App Inventor decide when to drop support for a particular Android version? Does that depend on userbase for that particular version?

It's been 13 years since Android 4 was released.

1 Like

So the only temporary fix for this problem is running an older version of AI2 by running a local server on my PC? if so, I'll try that.

1 Like

Hello
I've got the same problem with the 9 Tab Samsung Tab2 7inch of my school working with Android 4.1.2 and there is no new systeme upload !! so wehave to stop Dev on our projects!!!

I do not know why you are surprised, google ended support for 4.0.0 in 2018, between 2021 and 2023 google announced the end of support both in store and other service until kitkat 4.4.

It is more than obvious that AI2 in due time must stop supporting this versions, it can not continue to maintain compatibility for issues of libraries and plugins, among others!

I have identified the underlying problem and we are trying to figure out a fix for it.

1 Like

fyi

Taifun