-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Implementing .aar libraries for extensions. #2230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Can one of the admins verify this patch? |
@AppInventorWorkerBee ok to test |
Can this change get staged for nb185? cc @ewpatton |
@shreyashsaitwal This won't go into nb185. We could consider it for nb186. The goal with nb185 is first and foremost to fix issues that cropped up in nb184. |
We need to implement this so that we can solve the problem of building this extension: https://community.kodular.io/t/suggestion-for-building-an-extension/77477/15 |
Como usar a extensão para checar CNPJ? |
Will the resources contained in the aar end up in the application ? (as expected) |
Note: I am using this patch on my compilation server, it works, I hope you will integrate it soon. |
@ewpatton Any news regarding aar support ? |
Any update on this project? |
Change-Id: I6422e47b0dcdb7b3536658fe276b189aea4c01a3
I've updated this on top of the latest master. |
Would it be possible to merge this change with nb201? |
Yes, please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tested it locally after merging with mit's latest master branch, and it works perfectly with AARs in extensions. (ref)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it's not included in latest release. |
I have identified a problem with the inability to merge JNI/native (.so) libraries. |
JNI library support is a separate PR.Sent from my iPhoneOn Aug 10, 2025, at 13:00, Jewel Shikder Jony ***@***.***> wrote:jewelshkjony left a comment (mit-cml/appinventor-sources#2230)
I have identified a problem with the inability to merge JNI/native (.so) libraries.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
It'd be awesome if this PR also get merged. |
If this feature is merged then libraries related issues will be resolved very much in MIT App inventor ecosystem and will see many modern extensions related to UI and other modern android related features. One thing that i noticed is that assets in libraries( talking about nested assets) in the libraries are not included in the build apk. Also, I suggest that there should be two ways how assets are merged into the apk. First like traditional way, assets are placed under extension package folder in assets folder of apk. Second should be the root folder with nested folders lead to file as many libraries refer to the root folder path like |
There is also another way (again it's just a suggestion) is to place libraries related assets as they are like single file or folder within folder lead to file in the root of assets folder instead of placing them under their extension package name folder. OR we can give users ability in the designer section of App inventor frontend to create the files structure as they like(but again it will not be the scope of this PR but it will solve assets related issues as users can create their own file structures like simple file under assets folder like |
It would be great if this feature also handle merging assets and jni libraries. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assets in extensions can always be included using @UsesAssets
, which has always been true, and there is a separate PR to worry about native libs so I do not think it is worth holding up the release on those grounds.
String library = librariesNeeded.getString(j); | ||
copyFile(buildServerClassDirPath + File.separator + library, | ||
extensionTempDirPath + File.separator + library); | ||
copyFile(buildServerClassDirPath + File.separator + library, extensionTempDirPath + File.separator + library); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend restoring the original formatting here for this call as nothing has changed semantically.
copyFile(buildServerClassDirPath + File.separator + library, | ||
extensionTempDirPath + File.separator + library); | ||
copyFile(buildServerClassDirPath + File.separator + library, extensionTempDirPath + File.separator + library); | ||
if(library.endsWith(".aar")){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix whitespace after if
and before {
i.remove(); | ||
if (!processedLibs.contains(libname)) { | ||
if (!processedLibs.contains(lib)) { | ||
if (simpleCompTypes.contains(type) || type == "ANDROID") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rewrite the latter half of this conditional as "ANDROID".equals(type)
.
Thanks for merging this Sir. Really appreciated. But assets from aars will not be included in the apk. Build process will just ignore them at appinventor/buildserver/src/com/google/appinventor/buildserver/tasks/android/AttachCompAssets.java. It's looking for extension assets and during unzipping aar libraries assets will be ignored from asset list. |
The |
With this implementation it is possible to add an .aar type library in extension. Just use the existing annotation "@UsesLibraries (libraries ="library.aar ") and add the library to the dependencies, just like the .jar files.