The APK failed to install. Error: Could not parse error string

Jonathan picture Jonathan · Aug 10, 2018 · Viewed 73.8k times · Source

Dragging and dropping an Android Package *.APK into an AVD (Android Virtual Device) throws a cryptic error:

The APK failed to install.
Error: Could not parse error string
  • I've tried an AVD with the latest API (28) and one that matches my own phone (Nougat 7.0)
  • The APK is a python Kivy APK built with buildozer
  • I am new to Android development. I don't even know where to begin to debug this. Is there a better log?
  • If I upload the APK to the AVD via the file manager and install it fails as well.
  • HOWEVER, if I upload this same APK to my actual Android Device, IT WORKS! Not only does it install, but it opens and runs my app just fine with no errors
  • Unknown sources are allowed

    (int) Android API to use

    android.api = 24

    (int) Minimum API required

    android.minapi = 24

    (int) Android SDK version to use

    android.sdk = 24

    (str) Android NDK version to use

    android.ndk = 9c

enter image description here

The APK failed to install. Error: Could not parse error string

Answer

Melquiades picture Melquiades · Oct 15, 2018

HOWEVER, if I upload this same APK to my actual Android Device, IT WORKS! Not only does it install, but it opens and runs my app just fine with no errors

This tells me it might be because your app uses native libraries which don't match the emulator cpu architecture (see this question)

To get a more detailed error message, install your app via terminal:

adb install path_to_your_app/name_of_your_app.apk

You might see this:

adb: failed to install name_of_your_app.apk: Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries