String IndexOutOfBounds Exception while using extensions in companion app

Ok. Let me see if I can replicate it with an emulator. I don't have a device in my position with Android that old.

Unfortunately I can't test it with Niotron because the minSdkVersion is 23 (Android 6).

5th test on Galaxy A3 (Android 8.0.0): Works fine.

Galaxy S6 (Android 7) is deeply discharged, test follows...

Ok. Here's a newer version that tweaks the extension loading code a bit and adds some additional debug logs. If it still doesn't work on Android 5, please attach a copy of the logcat so I can take a look. This version is 2.73ad2.

https://www.dropbox.com/scl/fi/v2p08w9n16lpfri1phdip/MITAI2Companion-273ad2.apk?rlkey=vu3qzpu3z253dawhmy9fhogw6&st=7kai839r&dl=0

2 Likes

I am no longer associated with Niotron.

2 Likes

Now I didn't get an error and the extensions are where they should be: Computer\Galaxy Note3\Phone\Android\data\edu.mit.appinventor.aicompanion3\files\AppInventor\assets\external_comps
but no Button and Label are displayed and I get this error:

Galaxy S6 (Android 7.0): Works fine.

Xiaomi Mi A3 Android 11 loaded everything correctly.
I tried 7 extensions at once in one application.

Maybe App Inventor should consider making Companion available only from Android 6 onwards. Who tests on devices with API < 23 these days?

We'll be dropping support for SDKs lower than 14 next summer with the annual Google Play SDK compliance update.

1 Like

(added to FAQ)

logcat_GalaxyNote3_Android5.txt (105.2 KB)

1 Like

So based on the logs it looks like it's failing to create a specific directory on that device. It's odd that it's trying to do it on the external SD card directory. Do these devices have physical SD card slots?

Yes, the Galaxy Note3 has a removable SDcard slot, but there is no SDcard and the Galaxy Alpha doesn't have a SDcard slot.

Btw, the Galaxy Note8 (Android 9) also has a removable SDcard slot (and in my case there is a removable SDcard) and it works fine.

Galaxy S3 (Android 4.3):

Extensions work on Chromebook companion- build name: dedede android version: 13 security update: November 5

Motorola Moto G (Android 5.1):
It only works with one extension, but fails with two or more.

Had to update to 2.73ad2 for my Genymotion Pixel 8 emulator, Android 13, when using more than one extension.

The same project, with more than one extension, worked just fine using 2.73au on my Pixel 8a real device, Android 15.