question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

android:extractNativeLibs="true" for Dynamic Feature Module

See original GitHub issue

bundle-tool version 0.9.0

Currently I have some precompiled libs in main/jniLibs/arch/*.so and specifying

android:extractNativeLibs=“true”

in AndroidManifest.xml to extract them on install, now i want to move those libs to Dynamic Feature Module. where i specified bundle manifest as below

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:dist="http://schemas.android.com/apk/distribution"
    package="in.canews.nativelibs">

    <dist:module
        dist:instant="false"
        dist:title="@string/title_nativelibs">
        <dist:delivery>
            <dist:on-demand />
        </dist:delivery>
        <dist:fusing dist:include="true" />
    </dist:module>
    <application android:extractNativeLibs="true"/>
</manifest>

but on install of that feature libs are not extracted to libs folder of app.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
plecesnecommented, Apr 15, 2020

That seems to be working as intended.

If the native libraries belong to the dynamic feature and the dynamic feature is uninstalled, it is expected for the native libraries to be removed as well. The uninstallation is always deferred so it’s possible that the extracted native libraries remain a bit longer in the local storage, but they effectively should not be used.

0reactions
eakteamcommented, Feb 7, 2022

Is splitcompat dir has exec permissions targetting Api 29(Android 10) ? @canewsin

I believe it has such permission for application user. @ymakhno

It doesn’t have exec permissions, so the only way to execute executable native libs is to make Dynamic Feature module install-time. In that way it will extract native libs to default app native libs directory and you can execute from there.

Also strongly recommend to make /data/data/<package-name>/files/splitcompat able to execute native libs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Overview of Play Feature Delivery | Android Developers
Under Dynamic features to deploy in the General tab, check the box next to each feature module you want to include when deploying...
Read more >
Using native library inside dynamic feature module: Part 1
We will create a new project which contains an app module and add a dynamic feature module. Both of these modules contain activities...
Read more >
Dynamic feature module, Android OnDemand module
Consider an app with three dynamic feature modules and support for multiple device configurations. The below figure illustrates how it looks ...
Read more >
How to manage the code Dynamic Feature Module on app ...
I am working on dynamic feature module in android. But I couldn't find anything when I update the codebase or change the codebase...
Read more >
Reusing Dynamic Feature Modules (DFM)
application is a dependency of com.android.dynamic-feature modules, which means you can use any classes defined in the base module and its libraries in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found