how to add static libs to apex

Skip to first unread message

bon ami

Feb 9, 2021, 10:57:47 AM2/9/21
to android-porting
I have a static lib, whose Android.bp is like,
java_import {
    name: "a-V0.1-java",
    host_supported: true,
    installable: false,
    jars: ["a.jar"],

I can use it in modules other than this apex, since I have tried binaries, prebuilts, java_libs and no tags works for this lib. I wonder whether it is because lib a is on host, while an apex is for target, but in that case, why is there a native_shared_libs tag for apex? It would fit, IMO, if there is a native_static_libs tag.
     apex {
         name: "",
         defaults: [""],
         manifest: "apex_manifest.json",

other modules, which work, are like,
java_library {
 name: "framework-internal-utils", 
 static_libs: [  a-V0.1-java 

Thanks a lot

Evliyim Mutluyum Huzliyum

Feb 10, 2021, 4:22:27 PM2/10/21
to, android-porting

9 Şub 2021 Sal 17:57 tarihinde bon ami <> şunu yazdı:

You received this message because you are subscribed to the Google Groups "android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

bon ami

Feb 17, 2021, 6:55:32 PM2/17/21
to android-porting
adding following line to the makefile of the lib works,
  apex_available: ["//apex_available:platform", "//apex_available:anyapex", ],

Reply all
Reply to author
0 new messages