String IndexOutOfBounds Exception while using extensions in companion app

I'm asking about programmers, not moderators.

Yes, from version to version more and more restrictions. But I think that this particular change is for greater security.

For whom? Isn't it always the same argument?

Ok, then the answer is no.

probably @Atom_Developer could comment on this?
Taifun

I think he hasn't been there for a long time.

Here's a link to a development version with the new fix I have been working on that should work on both Android 9 and Android 14:

https://www.dropbox.com/scl/fi/oe2pbrmqkesyuyjjw1lm4/MITAI2Companion-273ad1u.apk?rlkey=stysrimdvj98wfzdpxujprz9p&st=vg5kl5y8&dl=0

WOW, this seems to work (at least on Android 13, Pixel 4XL, my first test) ...

Second test on Galaxy Note8 (Android 9): Works as well.

3rd + 4th test on Android 5.x:


I always deleted the Companion folder on the test device beforhand.

1 Like

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

1 Like

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