Can't open app on phone

I have made an app that can control an Arduino over BlueTooth. When I'm using MIT App Inventor and connect to my phone over WiFi the app works fine. When I build the apk file, either via the QR code or by manual upload to my phone I can install it. It shows up in my app list (picture) but it doesn't show up on my screen.

I have tried this on my present phone (LG Velvet LM-G900EM, Android 11, build V20g-EEA-XX) as on an older phone (Samsung Galaxy S5 Neo, Android 6.0.1) and on both phones I have the same problem.

I have no idea what I am doing wrong.

Neither do we, without seeing your project.

1 Like

Hello Sjoerd

There must be a difference between your App tested via the Companion and the APK. Since the App does not run - is it possible that you added your own Launch Icon, replacing the default App Inventor Icon? If so, it's probably too large or an incompatible format.

Check List:
https://www.professorcad.co.uk/appinventortips#TipsApk Cannot Build/Install/Run APK

2 Likes

OK, I'm new here. Since my project works fine in the IDE I didn't think that was necessary. Here are the screenshots:

I look at your blocks, but see nothing that could be causing the problem. The app icon is standard from what I can see. You will need to export your project to a .aia file and post it here on the forum. I will test it on my device.

Export your .aia file and upload it here.

.... that isn't all your Blocks? Screen Initialization Block? Screen On Error Block?

Does you APK pass all the tests in my check list?

Thank you. This is the aia file:

BT_Arduino.aia (41.4 KB)

I have added one block based on the list ChrisWard gave me. A screen initialization block.

Thank you for your reply. I'm working on the list. So far I have added the screen initialization. Still not working.

Thank you for the tutorial. I uploaded the file.

Did you set an icon for your app?

If you did not, the default icon would be an MIT App Inventor honeybee.

I tested your aia, compiled it as apk and it was installed in my prone (Xiaomi Mi A1, android 9) with no problem.

Checked your aia and the only thing I noticed was that app's icon was jpg. I attached an aia with app's icon in png format to test it . On my phone installs with no problem

BT_Arduino_1.aia (57.6 KB)

1 Like

That's on my check list. Not all manufacturers accept the jpg format, a single png is expected, or a family of icons auto-created by App Inventor from a master image.

2 Likes

It doesn't matter whether the launcher_icon format (uploaded in Media / assets) is a JPG or PNG. AI2 basically generates PNGs from it:

So your launch icon was the culprit, as I suspected. The Screen Initialization Block you have added cannot request Bluetooth in that way unfortunately. We can however use Activity Starter. We also need to ensure that Locate is switched on.

The Screen Initialization Block can be used to set-up your clock timers and check if Bluetooth is Enabled. I attach an example Basic Project that many people have used as the base for their own App. It will at least give you some tips on how to ensure success. Gets even more tricky when you want to receive data :grin:

BT_Basic_Setup_Send.aia (8.5 KB)

ImportProjectFromComputer

No, but the size (dimension) could / should be adjusted.

...but that has apparently not produced acceptable icons for the devices Sjoerd has tested, given that Dora's png icon does work.

The ideal would be to ensure App Inventor's code (to produce the icon family) is served with a png image for downscaling. I agree that once the icons have been created, the master should be removed. Hopefully that correction will be in the next release.

We can't tell just by looking at the file names in the APK whether or not the files are 100% good.

Anyway, let's see how Sjoerd gets on.

Thank you Chris. Your aia was uploaded to my phone and there were no problems at all. I see the app icon on my screen and I can open and use the app. I will use it as basis for my hobby project.