简体   繁体   中英

adb: failed to install my_application-aligned.apk: Failure [INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION: Failed to parse AndroidManifest.xml]

When I try to install my apk onto my Android Virtual Device in Android Studio with adb install my_application-aligned.apk , I get the following error: Performing Streamed Install adb: failed to install my_application-aligned.apk: Failure [INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION: Failed to parse /data/app/vmdl530526663.tmp/base.apk: AndroidManifest.xml] Could this be because the apk is corrupted? I can provide my Android Manifest file if that would help. I generated the APK by following this tutorial: https://medium.com/@_sathishshan/decompile-and-recompile-android-apk-7d375e1bca83 . Following this tutorial, I first downloaded an XAPK file from the internet. Then, I decompiled the APK and added some additional files to the application. Next, I recompiled the APK, and generated a new APK file. This new APK file is my_application-aligned.apk . Thanks!

check minSdkVersion , it's maybe too big.
or clear and rebuild project with androidstuidio.

Uninstall old app from device and re run this app to device again.

So this doesn't really answer how to get rid of the error, but I think this error is showing up because the original file that I downloaded from the internet was an XAPK file, not an APK file. I just tried to do this whole process again with an APK file downloaded from the internet (not an XAPK file), and the error did not appear. So it might have something to do with the original file that I decompiled being an XAPK.

It worked for me by clearing the builds folder

./gradlew clean 

or

Android Studio --> Build --> Clean

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM