0

I have migrated my android project to android q in android studio canary but whenever I try to run my project on my Google Pixel 2. I am getting this error I have also uninstalled the previous version of the app. I have done everything clean project rebuild invalidate the cache, but still see below error log:

11:40 AM    Failed to commit install session 1536794838 with command cmd package install-commit 1536794838. Error: INSTALL_FAILED_INVALID_APK: Failed to extract native libraries, res=-2
11:40 AM    Session 'app': Changes were not applied.
                    The application could not be installed: UNKNOWN_ERROR
                    Retry
Tanveer Munir
  • 1,956
  • 1
  • 12
  • 27
Mateen Chaudhry
  • 631
  • 12
  • 32

1 Answers1

2

try to add below in your manifest.xml inside application tag

android:extractNativeLibs="false"

This flag is to indicate whether or not the package installer should extract the native libraries from the APK to the filesystem. If set to false, then your native libraries must be page aligned and stored uncompressed in the APK. Hence, after setting it to false, you should also have below options configured in your build.gradle

packagingOptions{
    doNotStrip "*/armeabi/*.so"
    doNotStrip "*/armeabi-v7a/*.so"
    doNotStrip "*/x86/*.so"
    doNotStrip "*/x86_64/*.so"
}
shizhen
  • 12,251
  • 9
  • 52
  • 88
  • by setting it true it helps can you explain why it happening? – Mateen Chaudhry Mar 27 '19 at 07:32
  • android:extractNativeLibs="true" is working not false – Mateen Chaudhry Mar 27 '19 at 07:43
  • 1
    Yes, i saw that. Just be aware that marking it as true means `the package installer will extract the native libraries from the APK to the filesystem`. By setting it to `false` and applying the `packagingOptions` said above should also work. – shizhen Mar 27 '19 at 07:47