String IndexOutOfBounds Exception while using extensions in companion app

The fix is now up on ai2-test. You can download the updated companion, version 2.73t2u directly here.

companion

3 Likes

Going to test it today and give to you some feedback...

Strange because I had this problem for a few days on Android 14. In addition, I read in PR that on Android14 the jar file has the same name as the extension. In my case, it was still classes.jar in the error.

On Android 11 with Companion Version: 2.73t2u

  • Unable to load extensions.java.lang.StringIndexOutOfBoundsException: String index out of range: -1

Android 11 with Companion Version: 2.73u

  • everything works fine.

On Android 14 with Companion Version: 2.73t2u
In the console:

  • invoke: no method named `SetBackgroundColor' in class joejsanz.joedevglassmorphism.JoeDevGlassMorphism

On the device:

  • Unable to load
    file:https://ai2.appinventor.mit.edo/ode/download/file/6507989327478784/assets/external_comps/joejsanz.joedevglassmorphism/classes.jar

The apk of my project is installed and works perfectly, but in companion it has that error.

1 Like

Did you use ai2test server as well ?

Ran tests on three devices, using both the ai2test server and ai2 server, with companion 2.73tu.

For me this has fixed the "String IndexOutOfBounds" error on Android 12 (genymotion) and Android 13 (Pixel 4a)

Well done Jeff !!

What remains is a continuing issue with Android 14/15 in loading a project with an updated extension which is returning the error of being unable to load the classes.jar. This is with tests on Android 15 Pixel 8a. This failed to load to the two projects I tested, which loaded just fine with Android 12 & 13.

Yes, both servers.

Yes, it also works on my Pixel 4XL (Android 13), but it doesn't work on Android 14 (Pixel 7 Pro). The same error as before.

Working fine on android 11 (Samsung A30s) Emulator v2.73t2u
The only "problem" when you launch it on the companion shows to update the version of the companion skippable pressing "not now"

You do not get this if you use the ai2test server to load your aia project.

How can i get it?

It will be best to wait until the updated companion is released. You should not develop on ai2test, it is for testing new features. Jeff did link to the ai2test server in his post.

@jmP

You need to test with the updated companion app linked above

Ok thank you for the momentary solution!
p.s. write me if you need help to test or else.

It works for me on Android 14, but it's a Chinese POCO with HyperOs so the behavior may differ from native Android.

2.73t2u gives me a white screen and a runtime Error : invoke: no method named `OpenDatabase' in class java.lang.Boolean

Extension : simpleSqlite

I'm using buestacks to run the companion

Android 14 (Google Pixel 7 Pro):

You must test on the test server, not the normal server.

:thinking: I don't know why, but it works on my POCO X6PRO with Android14. For a few days I had a problem on the normal server and I had an error like you showed, but later the problem went away and it works for me even on the normal server.