The simplest AI2 compiled app "keeps stopping" on my phone

The HelloPurr example apk will not run on my phone which is a Moto G7 power running android version 10 patch level Feb 1,2021. The app crashes immediately with a message "keeps stopping". I have tried several example apps and they all do this same thing. Oddly they all work with the AI2 companion interface but this is not what I wanted. Any ideas? Jeff

I wonder if it might have something to do with the theme. Could you try adjusting the Theme property of Screen1, rebuild your app, and install the updated app on your phone?

You create a empty screen block or make mistake in your block show you blocks

Try this simple app (3MB, switching 2 virtual screens, Theme: Device Default):

Does it also crash?
If so, then something is wrong with your device.

to find out why it is stopping, try logcat

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

Thank you so much Anke,

Your virtualScreens apk also fails so it must be my miserable Motorola phone HW or the android system built for it. Has anyone tried AI2 with the open source android LineageOS? Jeff

Theme does not matter. I have tried several options permutations and all crash. Maybe time to go down the ADB rathole.

I think the only thing that might help with such a serious problem is a factory reset.

I doubt that is necessary given that other apps sound like they are working fine. @Jeffrey_Meyer if you can give us a stack trace of the crash using ADB it should be fairly easy for us to pinpoint what is causing the issue.

OK I captured the logfile with the linux adb tool. It captures thousands of lines of debug in just a second so I edited the file down to a few 100 lines that looked important. If you want the 10K line version I can redo the capture. It was done with the very simple KittyPurr example. The pared down file is attached. Thank you for your kind help. I owe you a beer! logfile.txt (59.9 KB) Jeff Meyer

I found one other clue as to why things may be crashing. During the apk install the last step of the installer is a dialog box with DONE or OPEN buttons. If you OPEN the app it will run once but after it is flushed from memory it crashes thereafter.
Confused.. Jeff
"I should be a butcher not an app creator."

this seems to be the relevant part in the log

05-10 13:59:44.978 16732 16732 D ziparchive: Zip: EOCD not found, /mnt/expand/63de3775-1ae9-4624-ace3-3d4636153f4f/app/appinventor.ai_meyerman.HelloPurr-KNUGUS_axfzaQaBJq8BlDQ==/base.apk is not zip
05-10 13:59:44.978 16732 16732 E erman.HelloPur: Failed to open APK '/mnt/expand/63de3775-1ae9-4624-ace3-3d4636153f4f/app/appinventor.ai_meyerman.HelloPurr-KNUGUS_axfzaQaBJq8BlDQ==/base.apk' Invalid file
05-10 13:59:44.979 16732 16732 E ResourcesManager: failed to add asset path /mnt/expand/63de3775-1ae9-4624-ace3-3d4636153f4f/app/appinventor.ai_meyerman.HelloPurr-KNUGUS_axfzaQaBJq8BlDQ==/base.apk
05-10 13:59:44.979 16732 16732 D AndroidRuntime: Shutting down VM
05-10 13:59:44.980 16732 16732 E AndroidRuntime: FATAL EXCEPTION: main
05-10 13:59:44.980 16732 16732 E AndroidRuntime: Process: appinventor.ai_meyerman.HelloPurr, PID: 16732
05-10 13:59:44.980 16732 16732 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Configuration android.content.res.Resources.getConfiguration()' on a null object reference
05-10 13:59:44.980 16732 16732 E AndroidRuntime: 	at android.app.ActivityThread.updateLocaleListFromAppContext(ActivityThread.java:6341)
05-10 13:59:44.980 16732 16732 E AndroidRuntime: 	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6579)
05-10 13:59:44.980 16732 16732 E AndroidRuntime: 	at android.app.ActivityThread.access$1400(ActivityThread.java:232)
05-10 13:59:44.980 16732 16732 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2014)
05-10 13:59:44.980 16732 16732 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:107)
05-10 13:59:44.980 16732 16732 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:241)
05-10 13:59:44.980 16732 16732 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7604)
05-10 13:59:44.980 16732 16732 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
05-10 13:59:44.980 16732 16732 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
05-10 13:59:44.980 16732 16732 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)

are you able to install other apps from Google Play?
is there enough space on your device on the internal (emulated) sdcard?
probably @ewpatton does have a better idea what could be the issue...

Taifun

No I have not had and trouble installing 200 other Play-Store apps. I have 1GB of extra RAM and 20GB spare FLASH. Its some issue with the Moto G7 phone. Everything works fine on a friends Samsung Galaxy tablet with less RAM and FLASH.
I saw the crash traceback too but you need the java source to make sense of it (way out of my league).

Does the MIT AI2 Companion from the Play Store work?
If so, uninstall it and download it e.g. from here and try to install it.

If that doesn't work, the APK may get corrupted while downloading. Try to open the APK with a zip program (7-Zip, WinRAR, ...) (right mouse click → 7-Zip → open archieve).

Try to open my test app (virtualScreens.apk), make a screenshot and post it.

grafik

How are you installing the compiled app to your phone? Are you downloading it to your computer first and then installing it (e.g., via adb) or are you directly downloading it to your device by scanning the QR code? If the latter, I wonder if the APK is being corrupted in some way by other software on the phone. If you could send us the APK from your phone we can do some analysis on it.

I have tried both the QR upload and also installing from the samba server on my desktop to the phone. I get the same issue both ways. I will try adb as well. I tried the same samba install on a slightly newer Moto G9 power phone android 10 Mar 1,2021 patch and all works! It looks like this is an isolated problem and I will quit wasting your precious time. I would like to thank each and everyone of you for your patience and help. Cheers Jeff

@Jeffrey_Meyer Just out of curiosity again (as this is really a strange issue):

If it works ...

If that doesn't work, copy the APK from your device to the PC and

Can the APK (which should be a zip file) open? If so, post a screenshot.

Greetings forum friends .... I raised the same problem as Jeffrey_Meyer with the application I made in AI2, on a redmi 9 xiaomi android 11 updated to its latest version. I rebuilt a streaming player again, I have made many changes to it and the problem is similar to that of Jeffrey, only that it installs me, but after about 20 minutes it only stops the audio and sometimes it appears a that only says time of execution. I do not know what else to do so that the audio does not stop ... if you can help me, I thank you. P.S.: I have used all the tutorials that I could get from here and on YouTube regarding the subject.

This iussue has nothing to do with this topic.
Search the forum (radio / streaming app). This problem has already been discussed extensively many times in all AI forums (AI2, Kodular, ...). The solution as well.

Hi,
I have a very similar problem with my Samsung galaxy S21 Ultra 5G running Android version 12.
There are no warnings or errors displayed in App inventor blocks.
The app works fine using the companion application on the phone however the .apk build crashes immediately.
The app .aia is here : Tts.aia (8.4 KB)
However I have been able to download and run successfully Anke's "virtualScreens.apk" (Thank you very much Anke!).
I am sure I must be doing something wrong but can't figure it out.
I would be grateful for any suggestion!