Thank you for the response Dan,

I already have *'jni_libs:[...]'* property set to native lib in 
*'android_app',* but still shared lib is generated
i set the property *`use_embedded_native_libs: true`* as well, along with 
native jni lib, it also embeds other native libraries which actually 
increased the APK size

is there a way where i can only embed the my jni lib and discard other 
libraries. (Also, any 'genrule' possible to access the library output path 
'out/product/....so' and include it as cc_prebuilt_library_shared)

Can you please elaborate more on below point, what is platform-only library 
here.
My native jni lib is actually dependent on other system shared libraries

"If you specify `jni_libs` of platform-only libraries, those will be copied 
into your APK, not shared with the system."

Regards,
Madhusudan
On Wednesday, July 24, 2024 at 1:29:27 AM UTC+5:30 Dan Willemsen wrote:

> The build system will install an APK with a correct layout for the 
> platform to use for their particular use case, just be sure to specify them 
> as `jni_libs: [...]` dependencies for the app. Manually changing that 
> shouldn't be necessary, though you may be able to adjust this behavior with 
> `use_embedded_native_libs: true`. This does not adjust what libraries your 
> APK can use, which is controlled by the platform. If you specify `jni_libs` 
> of platform-only libraries, those will be copied into your APK, not shared 
> with the system.
>
> If your intent is to take that APK and use it elsewhere, you really should 
> be building with `tapas` instead of `lunch` to build a generic APK. That 
> changes a handful of behaviors, including this one.
>
> - Dan
>
> On Mon, Jul 22, 2024 at 1:05 PM MaHeMa <mahema...@gmail.com> wrote:
>
>> Dear All,
>>
>> I am writing to request guidance on dynamically generating a native JNI 
>> library and bundling it inside an APK using the Soong build system. 
>> Currently, the library is generated in the system lib64 folder, but the 
>> requirement is to include the library within the APK.
>>
>> Could you please provide detailed instructions or confirm if this is 
>> feasible with Soong build? Any assistance or documentation on achieving 
>> this would be greatly appreciated.
>>
>> Thank you for your support.
>>
>> On Tuesday 9 July 2024 at 21:25:06 UTC+5:30 MaHeMa wrote:
>>
>>> it cannot be device specific as my lib depends on other system libs too
>>>
>>> Please guide me how to do it
>>>
>> -- 
>> -- 
>> 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.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/android-building/fef504fb-536b-407b-b81a-fe062bb77bdcn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/android-building/fef504fb-536b-407b-b81a-fe062bb77bdcn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-building/01cf6682-407e-4778-8bdc-f3ceb3a60190n%40googlegroups.com.

Reply via email to