There is no way to import a jar containing classes.dex files, you need to import a jar containing .class files.
On Mon, Jan 21, 2019 at 8:42 PM Ronny Pau <[email protected]> wrote: > That's one thing I have tried, but I am running into the following problem > around "Duplicate path classes.dex found", it seems like the classes.dex > from within the JAR is clashing with the one being produced by java_library. > > Then I tried to add the "dex_preopt" directive and setting enabled to > false, everything builds but the caller still doesn't see the package. > > > > > > > > > On Fri, Jan 18, 2019 at 2:11 PM Colin Cross <[email protected]> wrote: > >> I'd suggest combining the two: >> >> java_import { >> name: "myPrebuiltJar-prebuilt", >> jars: ["myPrebuiltJar.jar"], >> } >> >> java_library { >> name: "myPrebuiltJar", >> static_libs: ["myPrebuiltJar-prebuilt"], >> installable: true, >> } >> >> >> On Fri, Jan 18, 2019 at 9:02 AM Ronny Pau <[email protected]> wrote: >> >>> I have the same problem too. >>> >>> I have a prebuilt jar that needs to be brought in, I have tried both >>> java_import and java_library directives and neither works. Ideas? >>> >>> >>> java_import - seems to only create immediates but doesn't actually >>> bring the the jar to my target directory >>> java_import { >>> name: "myPrebuiltJar", >>> jars: ["myPrebuiltJar.jar"], >>> } >>> >>> >>> java_library - I see some immediates and the jar in my target >>> directory, but callers that makes use of the library do not recognize / >>> cannot import my package (build time error) >>> java_library { >>> name: "myPrebuiltJar", >>> srcs: ["myPrebuiltJar.jar"], >>> installable: true, >>> } >>> >>> On Wednesday, 5 December 2018 12:26:29 UTC-5, Zoran Jovanovic wrote: >>>> >>>> Ah, sorry for misunderstanding. >>>> >>>> >>>> Put "installable: true" somewhere under "java_library" in your >>>> library's blueprint. >>>> >>>> >>>> Cheers >>>> >>>> -- >>>> >>>> Zoran Jovanovic >>>> SW Architect >>>> Sony Mobile Communications Inc. >>>> Lund, Sweden >>>> >>>> >>>> ________________________________ >>>> From: [email protected] <[email protected]> on >>>> behalf of Ajay kumar <[email protected]> >>>> Sent: Wednesday, November 28, 2018 08:51 >>>> To: Android Building >>>> Subject: [android-building] Re: How to include prebuilt jars using bp >>>> in Android P >>>> >>>> Hi Zoran, >>>> Thanks for your reply. >>>> Our intention is to include this jar in system/frameworks as like >>>> frameworks.jar(which has been built on an engineering environment), it has >>>> to be used by a system service in frameworks. can you tell me how this can >>>> be achievable ?? >>>> >>>> Thanks, >>>> Ajay >>>> >>>> On Tuesday, November 20, 2018 at 9:02:21 PM UTC+5:30, Ajay kumar wrote: >>>> 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 [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]<mailto: >>>> [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. >>> >> -- >> -- >> 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 a topic in the >> Google Groups "Android Building" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/android-building/XosHgl6YFaM/unsubscribe >> . >> To unsubscribe from this group and all its topics, 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. > -- -- 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.
