简体   繁体   English

adb:无法安装 my_application-aligned.apk:失败 [INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION:无法解析 AndroidManifest.xml]

[英]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?当我尝试使用adb install my_application-aligned.apk aligned.apk 将我的 apk 安装到 Android Studio 中的 Android 虚拟设备上时,我收到以下错误: 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]这可能是因为 apk 已损坏吗? I can provide my Android Manifest file if that would help.如果有帮助,我可以提供我的 Android 清单文件。 I generated the APK by following this tutorial: https://medium.com/@_sathishshan/decompile-and-recompile-android-apk-7d375e1bca83 .我按照本教程生成了 APK: https://medium.com/@_sathishshan/decompile-and-recompile-android-apk-7d375e1bca83 Following this tutorial, I first downloaded an XAPK file from the internet.按照本教程,我首先从 Internet 下载了一个 XAPK 文件。 Then, I decompiled the APK and added some additional files to the application.然后,我反编译了 APK 并向应用程序添加了一些额外的文件。 Next, I recompiled the APK, and generated a new APK file.接下来,我重新编译了 APK,并生成了一个新的 APK 文件。 This new APK file is my_application-aligned.apk .这个新的 APK 文件是my_application-aligned.apk Thanks!谢谢!

check minSdkVersion , it's maybe too big.检查minSdkVersion ,它可能太大了。
or clear and rebuild project with androidstuidio.或使用 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.所以这并不能真正回答如何摆脱错误,但我认为这个错误正在出现,因为我从互联网下载的原始文件是XAPK文件,而不是APK文件。 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.我只是尝试使用从 Internet 下载的 APK 文件(不是 XAPK 文件)再次执行整个过程,并且没有出现错误。 So it might have something to do with the original file that I decompiled being an XAPK.所以它可能与我反编译为 XAPK 的原始文件有关。

It worked for me by clearing the builds folder它通过清除构建文件夹对我有用

./gradlew clean 

or或者

Android Studio --> Build --> Clean

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法解析 AndroidManifest.xml 中的 XML - Failed to parse XML in AndroidManifest.xml 错误无法解析 androidmanifest.xml 中的 xml - Error failed to parse xml in androidmanifest.xml 如何解决“Failed to parse XML in AndroidManifest.xml”? - How to solve "Failed to parse XML in AndroidManifest.xml"? 应用程序安装失败错误[INSTALL_PARSE_FAILED_MANIFEST_MALFORMED] - Application Installation failed error [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED] 应用程序安装失败安装失败,并显示以下消息:无法完成会话:INSTALL_PARSE失败,清单格式错误 - Application Installation Failed Installation failed with message Failed to finalize session : INSTALL_PARSE FAILED MANIFEST MALFORMED android APK安装失败 - Failed to install android APK 即使使用jarsigner签名后,INSTALL_PARSE_FAILED_NO_CERTIFICATES也无法安装修改后的APK文件(无效的SHA1签名) - INSTALL_PARSE_FAILED_NO_CERTIFICATES failure installing modified apk file (invalid SHA1 signature), even after signing with jarsigner 来自adb install的INSTALL_PARSE_FAILED_NO_CERTIFICATES; 使用Java 6,Android 5.0.2 - INSTALL_PARSE_FAILED_NO_CERTIFICATES from adb install; using Java 6, Android 5.0.2 "如何在我的 android 应用程序中修复 INSTALL_PARSE_FAILED_MANIFEST_MALFORMED" - How to fix INSTALL_PARSE_FAILED_MANIFEST_MALFORMED in my android application 发布 INSTALL_PARSE_FAILED_NO_CERTIFICATES - Release INSTALL_PARSE_FAILED_NO_CERTIFICATES
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM