You may want to run adb logcat so that we can see why the companion is crashing?
Companion version 2.72 is the first version that targets Android 14, therefore the Android 14 security rules apply. One of the changes, which is most likely the culprit, is that dynamically loaded executable code must be marked read only. We updated the companion to do this and at least in our testing on Android 14 it works. There may be manufacturer specific changes to the Android code though that are causing it to fail on other devices so any log data we can get will help us better understand the scope of the issue.
Hi,
I made some additional tests. With the ms egde browser It doesn't work either and I made another discovery: The "Taifun File" extension shows the same issues. If I load projects where this extension is used, the behaviour of the companion 2.72 is the same - only the initial screen of the companion is shown on the android device.
I'm not very familiar with the android OS (I actually program microcontrollers bare metal in C...) but I managed to get an log - it's a ton of data
The log is made with the example sqlite272Test4_11.
I broke it down to the following messages:
Line 4342: 08-26 19:51:17.260 2914 2914 E or.aicompanion3: Attempt to load writable dex file: /storage/emulated/0/Android/data/edu.mit.appinventor.aicompanion3/files/assets/external_comps/uk.co.metricrat.simplesqlite/uk.co.metricrat.simplesqlite.jar
Line 4343: 08-26 19:51:17.267 2914 2914 E AssetFetcher: Error in form.loadComponents
Line 4344: 08-26 19:51:17.267 2914 2914 E AssetFetcher: java.lang.SecurityException: Writable dex file '/storage/emulated/0/Android/data/edu.mit.appinventor.aicompanion3/files/assets/external_comps/uk.co.metricrat.simplesqlite/uk.co.metricrat.simplesqlite.jar' is not allowed.
I hope this helps... Or does anyone have any useful filter settings for adb?
Ok, well that confirms a part of my theory, but I'm not sure why it is happening. I may ask you to try out some experimental versions to see if we can fix the problem.
Hi ewpatton,
I'm happy to help
Here is a development version of the companion app. It includes a potential fix for the error reported in the log. You should be able to scan it with the existing companion app to download it and initiate an upgrade.
[Redacted; please see below for a new link]
Note, if you get a warning from App Inventor stating that the companion is "out of date", this is due to the fact that it is a newer version than the ones that App Inventor recognizes. Click the "Not Now" button to ignore the upgrade request (which would actually be a downgrade in this situation).
Here is an updated version, 2.72d2, that makes some further changes around the writeable logic of extensions.
[Redacted]
There is a new thread following this development here:
Hi ewpatton,
With this version I get an error message in the editor (browser):
Runtime Error
Unable to load extensions.java.lang.SecurityException: Writable dex file '/storage/emulated/0/Android/data/edu.mit.appinventor.aicompanion3/files/assets/external_comps/uk.co.metricrat.simplesqlite/uk.co.metricrat.simplesqlite.jar' is not allowed.
Note: You will not see another error reported for 5 seconds.
The above message comes with the example from TIMAI2.
I additionally checked with a project that uses the "Taifun File" extension:
Runtime Error
Unable to load extensions.java.lang.SecurityException: Writable dex file '/storage/emulated/0/Android/data/edu.mit.appinventor.aicompanion3/files/assets/external_comps/com.puravidaapps.TaifunFile/com.puravidaapps.TaifunFile.jar' is not allowed.
Note: You will not see another error reported for 5 seconds.
It looks like the error message is now being passed through, this error message was'nt shown before.
This one works normally. (Sorry for being offline, it was night here)
Hi Vor & friends, I encountered the exact same issue (Companion version: 2.72, Android version: 14, Device: Redmi Pad). When I tried to connect, loading bar always disappear at around 45% and nothing happened to the companion.
I tried to load the project on my friend's device (the exact same type of Redmi Pad as mine) with companion version 2.70, as well as on my phone (Samsung A54) with companion version 2.72, and it all loaded well.
I tried the 2.72u version, but unfortunately the issue remains.
Have you tested with the companion 2.72d2 above?
Hi TIMAI2,
I just tested with the companion 2.72d2 and this appeared:
(edit) I clicked "Not Now", and the project loads! Thank you so much everyone!
Select Not Now to proceed.
TIMAI2,
It loads well! Thank you.
Thank you for reporting and testing
Hi,
@TIMAI: Yes, I used 2.72d2
I made an additional attempt:
- uninstall the companion
- fresh install of the 2.72d2
Unfortunately it ends in the error message I posted above.
But when I explore the file system the file
edu.mit.appinventor.aicompanion3/files/assets/external_comps/uk.co.metricat.simplesqlite/uk.co.metricat.simplesqlite.jar
exists. I checked the file system before usage / connection, it was empty (as expected).
So the writing of the extension data seems to work.
Further attempts:
- fresh install 2.70, testing a project --> works. Now update to 2.72d2, fails.
If I remember correct, updating doesn't touch the contents of the folders. - fresh install 2.72, testing a project --> fails. Update to 2.72d2, fails.
By the way: The test project sqlite272Test4_11.aia doesn't work with companion 2.70, where sqlite272Test4_1.aia does.
Unfortunately I am still unable to connect the Companion successfully.
I created a simpleApp with a button which displays a notifier asking for a choice of A or B or Cancel (simpleApp_1.aia). This works although I am not sure the A B and Cancel options are displayed as I would expect them (screenshot 1)
I then imported the extension GetApiLevel.aix, I did not add and element into th UI. The result is screenshot 2 as you can see the App screen does not display the screen, the Companion is connected at this point because the Reset Companion Screen is enabled.
If I now close the connection and remove the extension GetApiLevel.aix there is no change i.e. the screen still does not display.
As you can see the MIT App Inventor 2 is Version 2.72
I have tried both Classic and Neo versions.
My original problem appeared about a week ago and I narrowed it down importing unsupported extensions for instance I imported the extension DynamicComponents
Create any component available in your App Inventor distribution and create instances of other extensions programmatically in runtime. Made with by Yusuf Cihan.
Extension Version: 2.3.0
Date Built: 2024-04-03
This is an extension I have been using with no problem for many months
SIMPLEAPP_2withExtension.aia (5.9 KB)
SIMPLEAPP_1.aia (1.9 KB)
I am using a Google Pixel 8a and a Samsung Tablet both Android 14
I have tried this on Chrome and FireFox
If you have a look I would be grateful.
Hi,
With the updated companion it appears to now be working.
However if I now build and install on Android Apps the I get a Bluetooth error:
Permission denied:ConnectWithAddress,ACCESS_FINE_LOCATION,edu.mit.appinventor.ble.BluetoothLE@7b3b475
I do not get this error when in debug mode
Also I have not seen this error before (in the last4 four years at least!!)
Bluetooth Extension
Extension Version: 20230728
Date Built: 2023-07-28
I have tried other version as well