Thanks for the help Colin,

that did the trick for me!

On Monday, April 15, 2019 at 3:14:10 PM UTC-4, Colin Cross wrote:
>
> PRODUCT_BOOT_JARS can't be set in your Android.mk, it has to be set in 
> your product makefiles that are selected by your lunch target.  
>
> On Mon, Apr 15, 2019 at 11:20 AM Elliott Mazzuca <[email protected] 
> <javascript:>> wrote:
>
>> Thaks for the fast reply Colin!
>>
>> I tried adding the suggested change into my local Android.mk file and now 
>> i get the following issue:
>>
>> vendor/xxxx/sample/mycustomelib/apk/anotherSampelFolder/*Android.mk:20*: 
>> error: cannot assign to readonly variable: PRODUCT_BOOT_JARS
>>
>>
>> why is this considered a readonly variable?  is there a prerequisite step 
>> i need to do before setting this?
>>
>> thanks again!
>>
>> On Monday, April 15, 2019 at 12:48:37 PM UTC-4, Colin Cross wrote:
>>>
>>> You can set PRODUCT_BOOT_JARS in your product makefile to add a jar to 
>>> the bootclasspath, but I'd suggest providing it as a library that the apps 
>>> that need it can load.
>>>
>>> On Mon, Apr 15, 2019 at 8:06 AM Elliott Mazzuca <[email protected]> 
>>> wrote:
>>>
>>>> I tried to give a specific title and i will elaborate a bit more:
>>>>
>>>> *What i am trying to do is expose the classes that are inside my jar 
>>>> file so they are on the default class path.*
>>>>
>>>> I have a sample app to test if this is working that i created that 
>>>> would uses these classes.  But they don't appear in the images class path. 
>>>>  
>>>> so i get a "ClassNotFound Exception" when i try to instantiate. 
>>>>
>>>>
>>>>
>>>>
>>>> I have a custom .Jar file where i have my own package, lets call 
>>>> it com.sample.myCustomLibrary
>>>>
>>>> This jar file is created in the vendor space in AOSP P (android 9) 
>>>> using an Android.bp file.
>>>>
>>>>
>>>> inside my Android.bp file, i have a "java_library"
>>>>
>>>> that looks like this:
>>>>
>>>> // myCustomLibrary.jar
>>>> java_library {
>>>>     name: "com.sample.myCustomLibrary",
>>>>     owner: "sampleOwner",
>>>>     installable: true,
>>>>
>>>>
>>>>
>>>>
>>>>     javacflags = [
>>>>         "-Xmaxwarns 9999999",
>>>>     ],
>>>>
>>>>
>>>>     srcs: [
>>>>         "lib/src/main/java/**/*.java",
>>>>     ],
>>>>
>>>>
>>>>     dxflags: [                        // not sure if i need this, but 
>>>> it didn't work
>>>>         "--core-library",
>>>>         "--multi-dex",
>>>>     ],
>>>>
>>>>
>>>>     optimize: {
>>>>         proguard_flags_files: [
>>>>             "lib/src/main/proguard-rules.pro",
>>>>         ],
>>>>     },
>>>>
>>>>
>>>>
>>>>
>>>>     vendor: true,  // not sure if i need this but it didn't work
>>>>     dex_preopt: {  // not sure if i need this but it didn't work
>>>>         app_image: true,
>>>>     },
>>>> }
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> I also added some of the classes to "preloaded-classes"  under 
>>>> frameworks/base/config/preloaded-classes
>>>>
>>>>
>>>> When i create a new AOSP build, i can see that the classes that i put 
>>>> into this "preloaded-classes" file are not exposed:
>>>>
>>>>
>>>> W/Zygote: Class not found for preloading: 
>>>> com.sample.myCustomLibrary.sampleClass1
>>>> W/Zygote: Class not found for preloading: 
>>>> com.sample.myCustomLibrary.sampleClass2
>>>> W/Zygote: Class not found for preloading: 
>>>> com.sample.myCustomLibrary.sampleClass3
>>>>
>>>> and i added the package to the 
>>>> /build/make/core/tasks/check_boot_jars/package_whitelist.txt
>>>>
>>>> com\.sample\.myCusomLibrary
>>>>
>>>> though i can't get my classes inside my pacakge to show up on the 
>>>> default class path.
>>>>
>>>> Any ideas on the missing steps i need to take?
>>>>
>>>> thanks!
>>>>
>>>>
>>>> -- 
>>>> -- 
>>>> 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].
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> -- 
>> -- 
>> You received this message because you are subscribed to the "Android 
>> Building" mailing list.
>> To post to this group, send email to [email protected] 
>> <javascript:>
>> To unsubscribe from this group, send email to
>> [email protected] <javascript:>
>> 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] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
-- 
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to