[英]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.