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] 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.
