String IndexOutOfBounds Exception while using extensions in companion app

Same result, the first extension loads fine and every other one doesn't.
No error message appears but the smartphone screen freezes.

Any ideas to help with this, using Machinelearning extension with Android 9/ 2.73a : giving the string out of index error
Android 14 with 2.73 works
What can be done, we have a workshop coming up in a day and need to fix this. Please help. TIA

You still have the workaround of building your app and running the apk

1 Like

Ok thanks, also will the app build and apk run on iphones also, sorry for asking as I cannot test that , since I have an Android.

Try using this version for now.
AI2 Offline Companion.apk
It works for me.

Exactly, try to add any other extension...


(I tested it on several devices (Android 5-13) with Version: 2.73au.)

this work for me

I added another extension to your project.
Try it:
BLEScanTest2.aia (213.3 KB)

On android 14 it works fine, on Samsung with android 9 there are errors, as if the methods from the extension were not recognized.

Any extension works, but only the first one. If I add any more, the companion stops working.

1 Like

Yes, as I said.

On Android < 14 it fails if there are more than one extension.

In reality isn't right I was using companion v2.73 on my Samsung the only problem is using extension, fails with the classic error "Unable to load extensions.java.lang.StringIndexOutOfBoundsException:
String index out of range: -1" but with v2.73d1u from @jis its all fixed and works perfectly.

We are no longer testing companion v2.73d1u. The companion in the play store has been updated and we are now testing the currently released companion v2.73a. If you want to be helpful, test with multiple extensions, not just one, and in the feedback provide more details about what phone, what Android. The information that everything works is not helpful, because it works for me too, but not on every phone.

2 Likes

Ok i missed this one, going ti test it right now!!!

Just test it using 10 different extension, for all its working to me, even using some of them together, all the components seems ok.
Android version: 11
Model phone: Samsung A30s

One reason more to publish only a basic companion app on Google Play...

And I think, we can expect more restrictions from Google in the future. .

Please see also this thread Map It: Displaying Locations on a Google Map - #13 by Richard_Boehm

That user is using several extensions...

I use aicompanion2.73a on GooglePixel8Pro with Android15

Taifun

This is a good idea. We would get rid of many problems.

Hello Taifun...I have a special question for you. If I have different projects e.g. When I import "Speech2" or "Player" into App Inventor 2, I get a runtime error in most of your projects. What could be the reason for this. Thanks in advance for your help. Richard




Did you update your companion app?
Which device and Android version are you using for your tests?

Taifun

Thanks for Information.
I use aicompanion2.73a on GooglePixel8Pro with Android15

Ok i will test different Projects

Greetings Richard

Please add one of your example projects here, so @jis can do some more tests

--

To avoid all this issues with the companion app I would like to repeat my suggestion from here String IndexOutOfBounds Exception while using extensions in companion app - #214 by Taifun

What about offering a basic Google Play version, without extension functionality

And the more advanced users, who like to test extensions or the texting component (or probably other restrictions in the future) can download an u version directly from MIT

Taifun