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

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!

The only thing I can see that is a bit strange is the . at the beginning of your API key (Firebase token). Not seen that before?

Interesting use of tags without any Project Bucket.

TIMAI2 thanks for the quick response.
I am very new to AI2 and am not sure yet how Project Bucket work so I will go and learn how to make use of it...
Not sure how this . has appeared? mayve a cut&paste error...
I have tried to remove it but it does not make a difference to the app crashing.

You do not need to state a Project Bucket in your designer settings if you do not want to. Your tags will be set under the main node, e.g.

ai2test-3x260-default-rtdb
--myTag: "\"123\""

You also do not need the / at the beginning of your tags, so myTag works the same as /myTag

Just looked at your project again

Firebase token should be:

YZraqToK0i9wJPXeYxwMpErdSkjAgD5MWeTyNMgt.m5qfOMhDdjylBiHPjncNNAwT0xZuguZiN9ZeJCNd7H8

Firebase url should be:

https://gfn-esp32-control-default-rtdb.firebaseio.com

Setting these makes your app run for me in companion app

The firebase url does not appear to be listed in the firebase config data any more ?
Look in the realtime database console, the url should be at the top above your data

Thank you TIMAI2 for the useful advice.
I have tried the following:
I have created a simpler app like so: IoT_Firebase.aia (2.9 KB) making sure I specify a project bucket this time and fixing the Firebase credentials and db address.
Again all works fine in the Companion app but crashes when I create an .apk on the phone.
However if I remove the Firebase component (and corresponding blocks) the app runs fine on the phone.
I don't really now what to do next...

OK, you are getting an error i have seen before which is related to using the EU firebase server.

Suggest you setup a new firebase project which uses the US firebase server and try again

2 Likes

Yeaaahhhh Success !
TIMAI2 I did what you suggested (US db instead of Belgium one) and it all started working!
Many thanks for the quick responses TIMAI2.
Do we know what the issue is with the European Firebase server in Belgium?
Do you know if there is a way to be informed of fixes/updates? It would be more logical as I am based in the UK.

In any case a ton of thanks for your help!

Not sure why, it worked ok a couple of years ago, and is still working for the project I set up then,but not now for a new project.

2 posts were split to a new topic: App keeps closing