Re: [android-building] How to include prebuilt jars using bp in Android P
Hi. The library doesn't need to be referenced in PRODUCT_PACKAGES, as it seems that it's not what it is. Your jar does however need to be accessible to Soong, e.g. in the 'prebuilts' project that Soong queries for all libraries (less likely) or in a path relative to your app's Android.bp (more likely). For example, copy the jar to your app's 'lib' folder and change java_import { name: "my-services", -jars: ["my-services.jar"], +jars: ["lib/my-services.jar"], } Next, in your build target, e.g. android_app, refer to the library by its java_import/name ("my-services" in your case) in one of the libraries blocks (depending on how you want it linked). That should be about it. Good luck. Cheers Zoran Jovanovic SW Architect Sony Mobile Communications Inc. Lund, Sweden From: android-building@googlegroups.com on behalf of Ajay kumar Sent: Tuesday, November 20, 2018 13:49 To: Android Building Subject: [android-building] How to include prebuilt jars using bp in Android P Hi Added jar file : this my Android.bp java_import { name: "my-services", jars: ["my-services.jar"], } am getting build error : ninja: error: 'out/target/common/obj/JAVA_LIBRARIES/my-services_intermediates/javalib.jar', needed by 'out/target/product/mydevice/dex_bootjars/system/framework/arm64/boot.art', missing and no known rule to make it I've added my-services in base.mk<http://base.mk/> under build/make/target/product/ and device/google/mydevice.mk<http://mydevice.mk/> to PRODUCT_PACKAGES. Thanks Ajay -- -- You received this message because you are subscribed to the "Android Building" mailing list. To post to this group, send email to android-building@googlegroups.com To unsubscribe from this group, send email to android-building+unsubscr...@googlegroups.com 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 android-building+unsubscr...@googlegroups.com<mailto:android-building+unsubscr...@googlegroups.com>. 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 android-building@googlegroups.com To unsubscribe from this group, send email to android-building+unsubscr...@googlegroups.com 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 android-building+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[android-building] How to include prebuilt jars using bp in Android P
Hi Added jar file : this my Android.bp *java_import {* * name: "*my-services*",* * jars: ["*my-services*.jar"],* * }* am getting build error : ninja: error: 'out/target/common/obj/JAVA_LIBRARIES/my-services_intermediates/javalib.jar', needed by 'out/target/product/mydevice/dex_bootjars/system/framework/arm64/boot.art', missing and no known rule to make it I've added my-services in base.mk under build/make/target/product/ and device/google/mydevice.mk to PRODUCT_PACKAGES. Thanks Ajay -- -- You received this message because you are subscribed to the "Android Building" mailing list. To post to this group, send email to android-building@googlegroups.com To unsubscribe from this group, send email to android-building+unsubscr...@googlegroups.com 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 android-building+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [android-building] How to include prebuilt jars using bp in Android P
Hi Dan, I've given a fresh build, now I'm getting new error as follows: ninja: error: 'out/target/common/obj/JAVA_LIBRARIES/my-services_intermediates/javalib.jar', needed by 'out/target/product/mydevice/dex_bootjars/system/framework/arm64/boot.art', missing and no known rule to make it I've added my-services in base.mk under build/make/target/product/ and device/google/mydevice.mk to PRODUCT_PACKAGES. Is there anything I'm missing?? -Shankar On Wednesday, September 26, 2018 at 4:37:14 AM UTC+5:30, Dan Willemsen wrote: > > To compile that > frameworks/base/services/core/java/com/example/sevice/myservice.java file, > you'd need to add your lib to the libs section of services.core.unboosted > in frameworks/base/services/core/Android.bp. > > - Dan > > On Tue, Sep 25, 2018 at 10:23 AM shankar kumar yellapu < > shankarku...@gmail.com > wrote: > >> Hi Dan, >> Thanks for quick reply, But my actual import from >> frameworks/base/services/core/java/com/example/sevice/myservice.java is >> saying error: package com.my.service.addon does not exist. >> >> If I give mm in frameworks/base/services/myservices/ says build >> successful. >> >> My Android.bp under /frameworks/base/services/ is as following: >> >> // merge all required services into one jar >> // >> java_library { >> name: "services", >> >> dex_preopt: { >> app_image: true, >> profile: "art-profile", >> }, >> >> srcs: [ >> "java/**/*.java", >> ], >> >> // The convention is to name each service module >> 'services.$(module_name)' >> static_libs: [ >> "services.core", >> "services.accessibility", >> "services.appwidget", >> "services.autofill", >> "services.backup", >> "services.companion", >> "services.coverage", >> "services.devicepolicy", >> "services.midi", >> "services.net", >> "services.print", >> "services.restrictions", >> "services.usage", >> "services.usb", >> "services.voiceinteraction", >> "android.hidl.base-V1.0-java", >> ], >> >> libs: [ >> "android.hidl.manager-V1.0-java", >> "my-services", >> ], >> >> // Uncomment to enable output of certain warnings (deprecated, >> unchecked) >> //javacflags: ["-Xlint"], >> >> } >> >> // native library >> // = >> >> cc_library_shared { >> name: "libandroid_servers", >> defaults: ["libservices.core-libs"], >> whole_static_libs: ["libservices.core"], >> } >> >> am I missing anything here??? >> >> Thanks, >> Shankar >> >> On Tuesday, September 25, 2018 at 2:35:38 AM UTC+5:30, Dan Willemsen >> wrote: >>> >>> You'll need to define your prebuilt using java_import: >>> >>> java_import { >>> name: "my-services", >>> jars: ["my-services-prebuilt.jar"], >>> } >>> >>> You shouldn't need the my-services vs my-services-prebuilt >>> differentiation like you did with make. >>> >>> - Dan >>> >>> On Mon, Sep 24, 2018 at 8:11 AM shankar kumar yellapu < >>> shankarku...@gmail.com> wrote: >>> Hi, I'm trying to include a jar in /frameworks/base/services/myservice using bp . My bp file looks like this: java_library_static { name: "my-service", static_libs: ["my-services-prebuilt"], } I've copied my prebuilt jar in the same location with the name my-services-prebuilt. I'm getting the following error: error: frameworks/base/services/my-services/Android.bp:29:1:"my-services" depends on undefined module ",my-services-prebuilt" FYR: my make file in Android O LOCAL_PATH:= $(call my-dir) # static jar # include $(CLEAR_VARS) LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := my-services-prebuilt:my-services-prebuilt.jar include $(BUILD_MULTI_PREBUILT) # shared jar # include $(CLEAR_VARS) LOCAL_MODULE := my-services LOCAL_MODULE_TAGS := optional LOCAL_STATIC_JAVA_LIBRARIES := my-services-prebuilt include $(BUILD_JAVA_LIBRARY) endif Can anybody tell me what I'm doing wrong?? Please send me proper bp script. Regards, Shankar -- -- You received this message because you are subscribed to the "Android Building" mailing list. To post to this group, send email to android-...@googlegroups.com To unsubscribe from this group, send email to android-buildi...@googlegroups.com 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"
Re: [android-building] How to include prebuilt jars using bp in Android P
Thanks Dan, I did the same It's working fine. Thank you very much. -Shankar On Wednesday, September 26, 2018 at 4:37:14 AM UTC+5:30, Dan Willemsen wrote: > > To compile that > frameworks/base/services/core/java/com/example/sevice/myservice.java file, > you'd need to add your lib to the libs section of services.core.unboosted > in frameworks/base/services/core/Android.bp. > > - Dan > > On Tue, Sep 25, 2018 at 10:23 AM shankar kumar yellapu < > shankarku...@gmail.com > wrote: > >> Hi Dan, >> Thanks for quick reply, But my actual import from >> frameworks/base/services/core/java/com/example/sevice/myservice.java is >> saying error: package com.my.service.addon does not exist. >> >> If I give mm in frameworks/base/services/myservices/ says build >> successful. >> >> My Android.bp under /frameworks/base/services/ is as following: >> >> // merge all required services into one jar >> // >> java_library { >> name: "services", >> >> dex_preopt: { >> app_image: true, >> profile: "art-profile", >> }, >> >> srcs: [ >> "java/**/*.java", >> ], >> >> // The convention is to name each service module >> 'services.$(module_name)' >> static_libs: [ >> "services.core", >> "services.accessibility", >> "services.appwidget", >> "services.autofill", >> "services.backup", >> "services.companion", >> "services.coverage", >> "services.devicepolicy", >> "services.midi", >> "services.net", >> "services.print", >> "services.restrictions", >> "services.usage", >> "services.usb", >> "services.voiceinteraction", >> "android.hidl.base-V1.0-java", >> ], >> >> libs: [ >> "android.hidl.manager-V1.0-java", >> "my-services", >> ], >> >> // Uncomment to enable output of certain warnings (deprecated, >> unchecked) >> //javacflags: ["-Xlint"], >> >> } >> >> // native library >> // = >> >> cc_library_shared { >> name: "libandroid_servers", >> defaults: ["libservices.core-libs"], >> whole_static_libs: ["libservices.core"], >> } >> >> am I missing anything here??? >> >> Thanks, >> Shankar >> >> On Tuesday, September 25, 2018 at 2:35:38 AM UTC+5:30, Dan Willemsen >> wrote: >>> >>> You'll need to define your prebuilt using java_import: >>> >>> java_import { >>> name: "my-services", >>> jars: ["my-services-prebuilt.jar"], >>> } >>> >>> You shouldn't need the my-services vs my-services-prebuilt >>> differentiation like you did with make. >>> >>> - Dan >>> >>> On Mon, Sep 24, 2018 at 8:11 AM shankar kumar yellapu < >>> shankarku...@gmail.com> wrote: >>> Hi, I'm trying to include a jar in /frameworks/base/services/myservice using bp . My bp file looks like this: java_library_static { name: "my-service", static_libs: ["my-services-prebuilt"], } I've copied my prebuilt jar in the same location with the name my-services-prebuilt. I'm getting the following error: error: frameworks/base/services/my-services/Android.bp:29:1:"my-services" depends on undefined module ",my-services-prebuilt" FYR: my make file in Android O LOCAL_PATH:= $(call my-dir) # static jar # include $(CLEAR_VARS) LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := my-services-prebuilt:my-services-prebuilt.jar include $(BUILD_MULTI_PREBUILT) # shared jar # include $(CLEAR_VARS) LOCAL_MODULE := my-services LOCAL_MODULE_TAGS := optional LOCAL_STATIC_JAVA_LIBRARIES := my-services-prebuilt include $(BUILD_JAVA_LIBRARY) endif Can anybody tell me what I'm doing wrong?? Please send me proper bp script. Regards, Shankar -- -- You received this message because you are subscribed to the "Android Building" mailing list. To post to this group, send email to android-...@googlegroups.com To unsubscribe from this group, send email to android-buildi...@googlegroups.com 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 android-buildi...@googlegroups.com. 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
Re: [android-building] How to include prebuilt jars using bp in Android P
To compile that frameworks/base/services/core/java/com/example/sevice/myservice.java file, you'd need to add your lib to the libs section of services.core.unboosted in frameworks/base/services/core/Android.bp. - Dan On Tue, Sep 25, 2018 at 10:23 AM shankar kumar yellapu < shankarkumaryel...@gmail.com> wrote: > Hi Dan, > Thanks for quick reply, But my actual import from > frameworks/base/services/core/java/com/example/sevice/myservice.java is > saying error: package com.my.service.addon does not exist. > > If I give mm in frameworks/base/services/myservices/ says build successful. > > My Android.bp under /frameworks/base/services/ is as following: > > // merge all required services into one jar > // > java_library { > name: "services", > > dex_preopt: { > app_image: true, > profile: "art-profile", > }, > > srcs: [ > "java/**/*.java", > ], > > // The convention is to name each service module > 'services.$(module_name)' > static_libs: [ > "services.core", > "services.accessibility", > "services.appwidget", > "services.autofill", > "services.backup", > "services.companion", > "services.coverage", > "services.devicepolicy", > "services.midi", > "services.net", > "services.print", > "services.restrictions", > "services.usage", > "services.usb", > "services.voiceinteraction", > "android.hidl.base-V1.0-java", > ], > > libs: [ > "android.hidl.manager-V1.0-java", > "my-services", > ], > > // Uncomment to enable output of certain warnings (deprecated, > unchecked) > //javacflags: ["-Xlint"], > > } > > // native library > // = > > cc_library_shared { > name: "libandroid_servers", > defaults: ["libservices.core-libs"], > whole_static_libs: ["libservices.core"], > } > > am I missing anything here??? > > Thanks, > Shankar > > On Tuesday, September 25, 2018 at 2:35:38 AM UTC+5:30, Dan Willemsen wrote: >> >> You'll need to define your prebuilt using java_import: >> >> java_import { >> name: "my-services", >> jars: ["my-services-prebuilt.jar"], >> } >> >> You shouldn't need the my-services vs my-services-prebuilt >> differentiation like you did with make. >> >> - Dan >> >> On Mon, Sep 24, 2018 at 8:11 AM shankar kumar yellapu < >> shankarku...@gmail.com> wrote: >> >>> Hi, >>> >>> I'm trying to include a jar in /frameworks/base/services/myservice using >>> bp . My bp file looks like this: >>> >>> java_library_static { >>> name: "my-service", >>> static_libs: ["my-services-prebuilt"], >>> } >>> >>> I've copied my prebuilt jar in the same location with the name >>> my-services-prebuilt. I'm getting the following error: >>> >>> error: >>> frameworks/base/services/my-services/Android.bp:29:1:"my-services" depends >>> on undefined module ",my-services-prebuilt" >>> >>> FYR: my make file in Android O >>> >>> LOCAL_PATH:= $(call my-dir) >>> >>> # static jar >>> # >>> include $(CLEAR_VARS) >>> LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := >>> my-services-prebuilt:my-services-prebuilt.jar >>> include $(BUILD_MULTI_PREBUILT) >>> >>> # shared jar >>> # >>> include $(CLEAR_VARS) >>> LOCAL_MODULE := my-services >>> LOCAL_MODULE_TAGS := optional >>> LOCAL_STATIC_JAVA_LIBRARIES := my-services-prebuilt >>> include $(BUILD_JAVA_LIBRARY) >>> endif >>> >>> >>> Can anybody tell me what I'm doing wrong?? Please send me proper bp >>> script. >>> >>> Regards, >>> Shankar >>> >>> -- >>> -- >>> You received this message because you are subscribed to the "Android >>> Building" mailing list. >>> To post to this group, send email to android-...@googlegroups.com >>> To unsubscribe from this group, send email to >>> android-buildi...@googlegroups.com >>> 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 android-buildi...@googlegroups.com. >>> 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 android-building@googlegroups.com > To unsubscribe from this group, send email to > android-building+unsubscr...@googlegroups.com > 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
Re: [android-building] How to include prebuilt jars using bp in Android P
Hi Dan, Thanks for quick reply, But my actual import from frameworks/base/services/core/java/com/example/sevice/myservice.java is saying error: package com.my.service.addon does not exist. If I give mm in frameworks/base/services/myservices/ says build successful. My Android.bp under /frameworks/base/services/ is as following: // merge all required services into one jar // java_library { name: "services", dex_preopt: { app_image: true, profile: "art-profile", }, srcs: [ "java/**/*.java", ], // The convention is to name each service module 'services.$(module_name)' static_libs: [ "services.core", "services.accessibility", "services.appwidget", "services.autofill", "services.backup", "services.companion", "services.coverage", "services.devicepolicy", "services.midi", "services.net", "services.print", "services.restrictions", "services.usage", "services.usb", "services.voiceinteraction", "android.hidl.base-V1.0-java", ], libs: [ "android.hidl.manager-V1.0-java", "my-services", ], // Uncomment to enable output of certain warnings (deprecated, unchecked) //javacflags: ["-Xlint"], } // native library // = cc_library_shared { name: "libandroid_servers", defaults: ["libservices.core-libs"], whole_static_libs: ["libservices.core"], } am I missing anything here??? Thanks, Shankar On Tuesday, September 25, 2018 at 2:35:38 AM UTC+5:30, Dan Willemsen wrote: > > You'll need to define your prebuilt using java_import: > > java_import { > name: "my-services", > jars: ["my-services-prebuilt.jar"], > } > > You shouldn't need the my-services vs my-services-prebuilt differentiation > like you did with make. > > - Dan > > On Mon, Sep 24, 2018 at 8:11 AM shankar kumar yellapu < > shankarku...@gmail.com > wrote: > >> Hi, >> >> I'm trying to include a jar in /frameworks/base/services/myservice using >> bp . My bp file looks like this: >> >> java_library_static { >> name: "my-service", >> static_libs: ["my-services-prebuilt"], >> } >> >> I've copied my prebuilt jar in the same location with the name >> my-services-prebuilt. I'm getting the following error: >> >> error: frameworks/base/services/my-services/Android.bp:29:1:"my-services" >> depends on undefined module ",my-services-prebuilt" >> >> FYR: my make file in Android O >> >> LOCAL_PATH:= $(call my-dir) >> >> # static jar >> # >> include $(CLEAR_VARS) >> LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := >> my-services-prebuilt:my-services-prebuilt.jar >> include $(BUILD_MULTI_PREBUILT) >> >> # shared jar >> # >> include $(CLEAR_VARS) >> LOCAL_MODULE := my-services >> LOCAL_MODULE_TAGS := optional >> LOCAL_STATIC_JAVA_LIBRARIES := my-services-prebuilt >> include $(BUILD_JAVA_LIBRARY) >> endif >> >> >> Can anybody tell me what I'm doing wrong?? Please send me proper bp >> script. >> >> Regards, >> Shankar >> >> -- >> -- >> You received this message because you are subscribed to the "Android >> Building" mailing list. >> To post to this group, send email to android-...@googlegroups.com >> >> To unsubscribe from this group, send email to >> android-buildi...@googlegroups.com >> 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 android-buildi...@googlegroups.com . >> 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 android-building@googlegroups.com To unsubscribe from this group, send email to android-building+unsubscr...@googlegroups.com 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 android-building+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [android-building] How to include prebuilt jars using bp in Android P
You'll need to define your prebuilt using java_import: java_import { name: "my-services", jars: ["my-services-prebuilt.jar"], } You shouldn't need the my-services vs my-services-prebuilt differentiation like you did with make. - Dan On Mon, Sep 24, 2018 at 8:11 AM shankar kumar yellapu < shankarkumaryel...@gmail.com> wrote: > Hi, > > I'm trying to include a jar in /frameworks/base/services/myservice using > bp . My bp file looks like this: > > java_library_static { > name: "my-service", > static_libs: ["my-services-prebuilt"], > } > > I've copied my prebuilt jar in the same location with the name > my-services-prebuilt. I'm getting the following error: > > error: frameworks/base/services/my-services/Android.bp:29:1:"my-services" > depends on undefined module ",my-services-prebuilt" > > FYR: my make file in Android O > > LOCAL_PATH:= $(call my-dir) > > # static jar > # > include $(CLEAR_VARS) > LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := > my-services-prebuilt:my-services-prebuilt.jar > include $(BUILD_MULTI_PREBUILT) > > # shared jar > # > include $(CLEAR_VARS) > LOCAL_MODULE := my-services > LOCAL_MODULE_TAGS := optional > LOCAL_STATIC_JAVA_LIBRARIES := my-services-prebuilt > include $(BUILD_JAVA_LIBRARY) > endif > > > Can anybody tell me what I'm doing wrong?? Please send me proper bp script. > > Regards, > Shankar > > -- > -- > You received this message because you are subscribed to the "Android > Building" mailing list. > To post to this group, send email to android-building@googlegroups.com > To unsubscribe from this group, send email to > android-building+unsubscr...@googlegroups.com > 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 android-building+unsubscr...@googlegroups.com. > 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 android-building@googlegroups.com To unsubscribe from this group, send email to android-building+unsubscr...@googlegroups.com 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 android-building+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[android-building] How to include prebuilt jars using bp in Android P
Hi, I'm trying to include a jar in /frameworks/base/services/myservice using bp . My bp file looks like this: java_library_static { name: "my-service", static_libs: ["my-services-prebuilt"], } I've copied my prebuilt jar in the same location with the name my-services-prebuilt. I'm getting the following error: error: frameworks/base/services/my-services/Android.bp:29:1:"my-services" depends on undefined module ",my-services-prebuilt" FYR: my make file in Android O LOCAL_PATH:= $(call my-dir) # static jar # include $(CLEAR_VARS) LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := my-services-prebuilt:my-services-prebuilt.jar include $(BUILD_MULTI_PREBUILT) # shared jar # include $(CLEAR_VARS) LOCAL_MODULE := my-services LOCAL_MODULE_TAGS := optional LOCAL_STATIC_JAVA_LIBRARIES := my-services-prebuilt include $(BUILD_JAVA_LIBRARY) endif Can anybody tell me what I'm doing wrong?? Please send me proper bp script. Regards, Shankar -- -- You received this message because you are subscribed to the "Android Building" mailing list. To post to this group, send email to android-building@googlegroups.com To unsubscribe from this group, send email to android-building+unsubscr...@googlegroups.com 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 android-building+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.