[INSTALL_FAILED_INVALID_APK: Failed to extract native libraries, res=-2] after Compile
See original GitHub issueInformation
- Apktool Version (
apktool -version) - 2.3.0 - Operating System (Mac, Linux, Windows) - Windows
- APK From? (Playstore, ROM, Other) - PlayStore
Stacktrace/Logcat
Include stacktrace here
After recompile apk and signed I have this issue when install recompiled apk…
`Failure [INSTALL_FAILED_INVALID_APK: Failed to extract native libraries, res=-2]
Steps to Reproduce
apktoolapktool.bat r …apk
Frameworks
If this APK is from an OEM ROM (Samsung, HTC, LG). Please attach framework files
(.apks that live in /system/framework or /system/priv-app)
APK
If this APK can be freely shared, please upload/attach a link to it.
http://www17.zippyshare.com/v/cE36EDY0/file.html
Questions to ask before submission
- Have you tried
apktool d,apktool bwithout changing anything? yes - If you are trying to install a modified apk, did you resign it? yes
- Are you using the latest apktool version? yes
Issue Analytics
- State:
- Created 6 years ago
- Comments:18 (7 by maintainers)
Top Results From Across the Web
Targeting SDK Android Q results in Failed to finalize session ...
Targeting SDK Android Q results in Failed to finalize session : INSTALL_FAILED_INVALID_APK: Failed to extract native libraries, res=-2.
Read more >Failed to extract native libraries, res=-2 bitrise build
Description of the issue. After adding Twilio library to the project generated APK size is twice bigger then when I'm building from Android...
Read more >Failed to extract native libraries, res=-2] | by July | Medium
The question says that the native library cannot be extracted. Cause Analysis: Google introduced extractNativeLibs after Android 6.0: android:extractNativeLibs:
Read more >Failed to extract native libraries, res=-2 - MSDN - Microsoft
Hi! After upgrading to Version 8.7 (build 2037) I can't distribute my Android APK, it works fine when running on Release-mode thru VS ......
Read more >Failed To Extract Native Libraries, Res=-113 - ADocLib
To get around it use the following block in your app's build.gradle file: ... INSTALLFAILEDINVALIDAPK: Failed to extract native libraries res2 bitrise build...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Seems to work with 2.4.2-d3f9d5-SNAPSHOT.
After rebuilding,
zipalignit using this command:zipalign -p -f 4 input.apk output.apkThen sign it withapksignerand should work now.With the current version of the Android build environment the manifest attribute
/manifest/application[@android:extractNativeLibs]is always set tofalse. This means the libraries in the APK are page aligned by the build environment (not to confuse with zipaligning the whole APK) and the loader loads them directly from the APK (presumably storage space considerations). When the ApkTool (version 2.4.0) recompiles such an APK it doesn’t change the manifest settings but due to the recompilation the resulting library file layout in the APK is not page aligned anymore, and that’s the cause the loader fails and the error occures. Removing the attribute or explicitely setting it totrue(the default value) prevents the bug to happen.