Help test nb202

This is the third time I'm posting this test app. With Companion, I get a permission error with the File.Read method. With the APK, all READ permissions (AUDIO, IMAGES, VIDEO) must be granted for the File.Exists method to work. If just one permission is denied, you get a permission error.

Therefore, I repeat my suggestion to remove all automatic storage permission requests (at least for later Android versions, Android 11+).

FilePermission_bug2.aia (2.6 KB)

Blocks

The layout issue has been fixed (on Android 15+).


Tested on Android 16.

Are you sure we’re talking about the same thing? The extension I shared doesn’t have any of those classes or resources.
Also, if we edit the .aia file and add assets in folders like assets/test/somefolder/somesetting.xml, then import that edited .aia to the test server and build the APK, the APK’s assets folder doesn’t contain those files.

There are no such subfolders in the assets.

I've built an aix to test.

Check this aia in above post. And Yes, android app asset folder can have subfolders.

Yes, but you can't access them. Check it out. Again you cannot have subfolders in the assets (at least not with AI2 or one of its clones).

What about the assets of extensions. They are in asset folder of apk under a folder named after the package name of extension. So that means that App Inventor built apps can have subfolders in assets.

Then show me this (sub)folder in the APK. :face_with_monocle:
I'm curious ...

1 Like

Download and import AiA I have shared above in test server. Build Apk and decompile. See the asset folder of decompiled Apk.


Do not confuse app assets with extension assets they are located in two different places in the app.

Does your extension icon show up in your media folder? No, because it is an extension asset.

1 Like

Each extension can have its own resources in an assets folder. However, these resources are placed in separate folders. Resources added in the AI2 designer don't have folders, whereas extension resources are placed in folders. If I remember correctly, the folder name is the extension package name.

3 Likes

Ok. I'll take a look at it today.

Unfortunately, it was unable to merge assets files also. The AAR file has a .txt file in assets and it is absent in the APK. I've decompiled the apk and that .txt file is not found in the assets directory.

Yes, with resources it's working fine but assets from libraries (not extension assets but libraries assets) are not included in the apk.

But sometimes libraries contain Drawables in png form and are in the same directories as the xml files.

1 Like

Yes, but I haven't tested with that type of AAR.

I tested the AAR add-in function from extensions. I used the Android x Media3 library and the session module. Unfortunately, the APK fails to compile and receives an aapt error for no apparent reason. The library contains many drawables and language files. Could this be a memory issue on the build server? After removing a larger number of language files, the APK compiles.

2 Likes

Can you send me the test aia so I can try it locally?

These two projects are identical and use the same extension. Both have the aar library included. In one project, I manually removed the res folder from the aar library.

This project does not compile:

ai2player_problem.aia (3.3 MB)

This project compiles:

ai2player_noproblem.aia (3.0 MB)

Ok, I see detailed errors in the local console. Layout resources from the Media3 session module require xml dependencies from other modules, which is why I'm getting a compilation error.

I think it would be useful to add the display of aapt errors to the browser's compilation error log.