That is expected. The 2.73t2u companion was built on top of the code on ai2-test, which has some newer stuff.
This post will attempt to address several issues. As Evan has
mentioned, starting with Android 14, the classes.jar file will not
load unless it is read-only.
Some manufacturers, not all, use a filesystem for the "sdcard" that
does not support making a file read-only. So we moved loaded
extensions, and only loaded extensions to the app's private cache
directory. Exactly where this is can very based on Android version and
manufacturer (we ask the device at run-time where it is).
On my Samsung S22+ running Android 14 this is:
/data/user/0/edu.mit.appinventor.aicompanion3/cache
Note: the last part of the path is cache, not files!
Other assets remain in the "sdcard" filesystem, which on my device is:
/storage/emulated/0/Android/data/edu.mit.appinventor.aicompanion3/files
There is a bug, thanks to you all, that because we made the classes
file read-only, we cannot over-write it when you attempt to load a new
version (duh!). We missed this in testing because we tested with an
unchanging extension. And when you load an extension that had been
previously loaded, we compute a hash of the classes file (and other
assets as well) and do not attempt to store them if we already have a
copy.
I am working on a fix for this. I'll post a test Companion here when
it is ready. This companion will have version 2.73d1. Note: I will
build it against MIT App Inventor nb199, the version running on
ai2. This will avoid confusion with differing versions of ListView
(ai2-test has a new version of ListView). So you should use this
version with ai2, not ai2-test. You will get a warning that ai2
doesn't know about version 2.73d1, just click the not now button
and all should be well.
Thanks for your job man! I really appreciate it!
Herewith some output:
~$ adb logcat "*:s,ReplForm:d"
* daemon not running; starting now at tcp:5037
* daemon started successfully
- waiting for device -
--------- beginning of main
11-28 16:39:29.674 19823 19823 D ReplForm: onCreate
11-28 16:39:29.721 19823 19823 D ReplForm: onCreateFinish() Called in Repl
11-28 16:39:29.721 19823 19823 D ReplForm: Intent = Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 pkg=edu.mit.appinventor.aicompanion3 cmp=edu.mit.appinventor.aicompanion3/.Screen1 bnds=[67,846][272,1119] }
11-28 16:39:29.721 19823 19823 D ReplForm: Did not receive any data
11-28 16:39:29.763 19823 19823 D ReplForm: HandleReturnValues() Called, replResult = null
11-28 16:39:34.793 19823 19823 I ReplForm: started AppInvHTTPD
11-28 16:39:43.736 19823 19823 D ReplForm: returnRetvals: {"status":"OK","values":[{"status":"OK","type":"return","value":"","blockid":"-1"}]}
11-28 16:41:05.119 20111 20111 D ReplForm: onCreate
11-28 16:41:05.167 20111 20111 D ReplForm: onCreateFinish() Called in Repl
11-28 16:41:05.168 20111 20111 D ReplForm: Intent = Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 pkg=edu.mit.appinventor.aicompanion3 cmp=edu.mit.appinventor.aicompanion3/.Screen1 bnds=[67,846][272,1119] }
11-28 16:41:05.168 20111 20111 D ReplForm: Did not receive any data
11-28 16:41:05.220 20111 20111 D ReplForm: HandleReturnValues() Called, replResult = null
11-28 16:41:10.001 20111 20111 I ReplForm: started AppInvHTTPD
11-28 16:41:20.862 20111 20111 D ReplForm: returnRetvals: {"status":"OK","values":[{"status":"OK","type":"return","value":"","blockid":"-1"}]}
(this is for the classes.jar not loading error)
Error appears on device @ the last two entries
Oh, I didn't do this on the ai2test server...
To simplify the fix, maybe it would be better to unify the behavior and always move extensions to the companion cache regardless of the android version?
Remember: 2.73d1u is intended for ai2, not ai2-test and you will need the click the "Not Now" button.
I checked it again and it seems that your are right. But then it should work for the first time, when (after) you uninstalled and reinstalled the Companion app.
Your fix works for me. OPPO android 14.
- loading extension for the first time, no error
- loading updated extension, no error, new methods available
Yes, that's what the previous fix did for me. It loaded the extension the first time, but didn't update it. I think @TIMAI2 had the same symptoms. Try the new Companion and see if it works for you now.
Yes, it seem to work fine now!
Scanning qr code fails with companion app, and I don't / won't have a drop box account...
You need to click "Continue Download". Screenshot in Polish, but the login screen will be similar in English.
I copied the Dropbox link to my computer and downloaded the Companion app from there without logging in.
Yay it works
Well done again Jeff !!
Unfortunately it's not working here...
If I change the phone on bluestacks settings (i don't find android version...)
What device/android version is bluestacks emulating ?
Have you tried on a real device ?
What is your logcat output, as requested above ?
Does the emulator also provide internal cache memory partitions with the ability to set the read-only flag?
Unable to load extensions.java.lang.StringIndexOutOfBoundsException: String index out of range: -1 when i try to connect with a phone
See the updated extension above