Is it possible to add natives (.so) to my application?

I am developing an extension and I need to add the / lib / folder together with the natives (.so). I am currently using the decompiler to add (it works), but I was wondering if there is any way to package in the extension. I used @UsesNativeLibraries, but did not include the (.so) files in the .aix, until I tried to compile the apk, but I received the following error: ________Attaching native libraries. I decided to look in “/appinventor-sources/appinventor/buildserver/src/com/google/appinventor/buildserver/Compiler.java” where the native files should be, so I found the /files/ directory of the extension directory, then added the folders.

Directory /files/ of the extension:

image

When importing the extension I’m getting this error:

image

The extension ended with 14 mb. Trying to reduce the size, I replaced the natives (.so) with smaller ones and the extension changed to 3mb. The application has been successfully compiled. But the / lib / no apk directory was not created.

Apk directory:

image

How it should look:

image

1 Like

Unfortunately you can’t add native libraries to an extension . You can read this in the Google Docs.

1 Like

Can you link the respective doc here?

1 Like

Here are two sources for you:

  1. How to add a component for the builder that includes how to work with native libraries:
    https://docs.google.com/document/d/1xk9dMfczvjbbwD-wMsr-ffqkTlE3ga0ocCE1KOb2wvw/pub#h.3kn0fmfydnq1

  2. The google groups discussion about this issue:
    ‏مجموعات Google

It would be really great if MIT adds support for native libraries within extensions some day.
This would offer new horizons.

3 Likes

Thanks for sharing this, @Django_s_Android_App.

BTW @jarlissonlira2, I’ll suggest you to open a new topic addressing this issue in the MIT App Inventor 2 forum.

3 Likes

Thank you all!

1 Like