String IndexOutOfBounds Exception while using extensions in companion app

exactly, but at this point maybe a change off extension in their file sys and now the emulator tries to open it but he dosen't find it giving out the error?

Ok. Extensions are loaded into the cache folder: /data/data/edu.mit.appinventor.aicompanion3/cache/external_comps/
This is from the ai2 source code. I'll check if these files are there.

They are here:

  • On a test server, with a test companion.

  • On the stable server with companion 2.73U I have the error again:

Unable to load extensions.java.lang.StringIndexOutOfBoundsException: start 1, end 0, length 0

But after another try it already works.

  • Stable server and test companion works well.

i heard about it but i don't know what is it, or how to use it there is a forum or something to learn what is it for and use it?

yes, this link http://sunnythedeveloper.epizy.com/2019/09/27/filetools-some-tools-to-work-with-files/ does not work anymore

I found this link working:

link in the directory is now updated...

Taifun

1 Like

Same result with:
file:///data/user/0/edu.mit.appinventor.aicompanion3/cache/external_comps/

It's like separate data for different users, something like the User/AppData/Local and Roaming folders in Windows. I don't know if any Android supports multiple accounts, maybe it's related to a Google account. But if there's one account, the data in the data folder will be the same as in the user folder. But here it doesn't really matter.

What phone are you using, what version of android do you have and what version companion do you are using?

Ah good, we are back on topic :wink:

1 Like

I was able to save, write, delete and modify any file in PrivateDir's cache folder, such as this one (I appended "_123" there) and then read the file using my MFile extension:

/data/user/0/edu.mit.appinventor.aicompanion3/cache/external_comps/de.bodymindpower.GetASD/oat/arm64/de.bodymindpower.GetASD.vdex

grafik


As I already assumed, the PrivateDir cache folder and the files there are not read-only. The same applies to /data/data/edu.mit.appinventor.aicompanion3/cache/external_comps/.

Hmm, what's about a simple Google search "Niotron"? :face_with_monocle:

1 Like

To make the file read-only, you must first set the appropriate File.setReadOnly() method.

Hmm, what do I have to do with that? :upside_down_face: If it's necessary at all, then AppInventor should have to do it...

Perhaps this only applies to the jar file. We'd have to check the ai2 sources.

... doesn't mean that the file cannot be deleted? That would make no sense at all. A typical example of read-only files are assets, and these, as we know, cannot be deleted.

I was able to delete any JAR file using my MFile extension or FileTools.

The whole thing is just a poke in the dark. We should wait and see if @ewpatton can give us a plausible explanation for this whole mess.

I do, same error on ai2-test with companion 2.73t2u

I think you can delete a read-only file. You can't edit it.
I think it can't be overwritten either. Companion tries to overwrite it and it's possible that this is a problem with the lack of method updates in the new version of the extension.

I tried to find something about these Android 14 limitations that Evan mentioned, but I couldn't find anything. I don't know if it's an Android limitation or a Samsung invention.

If you can capture logcat output, it would be helpful. There are some special debuging logs in 2.73t2. The logcat command to use is:

logcat '*:s,ReplForm:d"

This will filter out everythin but the "interesting" lines.