Testing the next release of MIT App Inventor (nb187)

Were helper blocks tested with extensions? Because I am getting an error.

I am using the UCR source to build the extension

1 Like

You already suggested it in post #27

now there are three four posts cluttering up the topic.....

Ok, sorry, as no one had answered me I didn't know if you had seen it, I'm really sorry.

Here's an example where I copy files from the assets to the app private directory. You could also use the private directory, but that's more complicated to verify. This worked in both the companion and APK on a Samsung tablet running Android 10.

HelloPurrAssets.aia (186.0 KB)

Tested on Android 11, Companion:

Since I don't have the ability to upload to GooglePlay I had to extract the apk from aab file..

Player component doesn't play sounds from assets, neither do I get any error.

Can someone confirm this.
MusiPlayMIT.aia (3.4 MB)

P.S. It works if build as apk..

1 Like

Obviously the same problem as Kodular.

Did you also check this with the TaifunPlayer?

Just tried and neither does Taifun's player work but this one at least tells me that it can't load audio file..

Thanks for the AAB reports. I've put it on my calendar to look at it this afternoon. If I had to guess, my first thought is that the assets are ending up in a different location when the APK is reconstructed from the AAB than where App Inventor puts them by default in the APK structure.

5 Likes

As I said earlier, there is the same problem with Kodular.
But why does the ExoPlayer work there (if the assets are in a different location)?

@Diego from Kodular implemented the AAB support as a GSOC project last summer. Kodular has had it merged into their system for a longer period of time. As for ExoPlayer, I'm not particular familiar with how it is implemented so I can't really answer that.

3 Likes

If it helps, the extracted apk was decompiled with apktool, edited apktool.yml file and added - mp3 to it, compiled..

Afterwards it worked

P.S. that line exist in apktool.yml file if APK is decompiled..

1 Like

Btw, what about this issue (copy a file from the assets to the privateDir)?
@ewpatton

@Boban I think I have a lead on how to fix the asset issue. I'm not sure that I will have it done tonight but I do think I'm close to getting it working.

@Anke I will take up your private file issue next, but if I understand what is happening correctly you may need to change the Scope property from App to either Legacy or Private.

2 Likes

I did test them with extensions (see the PR description here), but that was over a year ago now :confused: I could have introduced a problem later during my internship, or something could have changed in the mean time.

Either way, I hope the core team can get it figured out. Sadly I don't have time to work on this myself right now, otherwise I'd be jumping to it :confused: Making the helper blocks work for extension developers was one of my core concerns throughout the design process. So I really hope that you guys will be able to use them! If not in this release, then hopefully in a future one.

I think they work when you use one of the built-in helper block types defined in the com.google.appinventor.components.common package, but not if you declare your own type in the extension. The way the code is written in the ComponentProcessor, it assumes that the helper type is available in the classpath, which won't be true if the target helper class is being compiled at the same time as the extension.

As a workaround, one could probably compile a separate JAR to define the helper class, and then include that JAR as a dependency of the extension (making it available for the ComponentProcessor).

1 Like

Huh that's so weird! I thought the special directory placement that is required got around that, but I guess not :confused:

Thanks, that helped resolve some of the issues. I think that there may be a bug in how the build system packages subdirectories and so that is preventing the helpers from being bundled in correctly. I should be able to narrow it down from here.

1 Like

A potential fix for the AAB packaging breaking media-related components is pending here:

2 Likes