Another update:

The aar ends up in the system/framework as expected. However, when I build 
an APK (using compileOnly linking to the aar for development) and then run 
it on the device, when I try to reference a simple class from the aar I get 
a ClassNotFound exception.

Didn't find class "blahblah" on path: DexPathList[[zip file 
"/data/app/blahblah-alZcI7F0c4pu3uaE3oKynw==/base.apk"],nativeLibraryDirectories=[/data/app/blahblah-alZcI7F0c4pu3uaE3oKynw==/lib/arm,
 
/system/lib, /vendor/lib]]

I would have thought that having the package in PRODUCT_BOOT_JARS it would 
have added the aar file to the class path and would have allowed 
referencing it.

I read somewhere that aar files are not applicable for loading this way... 
On Monday, September 28, 2020 at 4:23:15 AM UTC+3 George Vlahakis wrote:

> Dear all,
>
> I found that adding the module name to PRODUCT_PACKAGES at least copies 
> the aar files in the target folder.
>
> I do not know if it will now be possible to dynamically load the aar (like 
> a jar) and use it in an APK. Will try and report with in.
>
> Thanks
>
> On Monday, September 28, 2020 at 4:11:04 AM UTC+3 George Vlahakis wrote:
>
>> I need to add a couple of aar's in system/framework folder to be 
>> available by the custom device developers to use in their applications.
>>
>> I have already managed to compile and include normal JAR files to this 
>> folder during AOSP build, but I am having trouble figuring out what needs 
>> to be the content of my Android.mk file to copy pre-built aar files to the 
>> system/framework.
>>
>> Already added them in PRODUCT_BOOT_JARS.
>>
>> Sample of my Android.mk:
>>
>> include $(CLEAR_VARS)
>> LOCAL_MODULE := moduleName
>> LOCAL_SRC_FILES := moduleName.aar
>> LOCAL_MODULE_CLASS := JAVA_LIBRARIES
>> LOCAL_MODULE_SUFFIX := .aar
>>
>> include $(BUILD_PREBUILT)
>>
>> If I mm in the directory it creates the intermediates correctly but does 
>> not copy the result to the final image /system/framework
>>
>>
>>

-- 
-- 
You received this message because you are subscribed to the "Android Building" 
mailing list.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-building/9a25f270-f7fd-4cd4-8e91-370883e3b95an%40googlegroups.com.

Reply via email to