任务':app:packageDebug'的执行失败-无法读取zip文件 [英] Execution failed for task ':app:packageDebug' - Failed to read zip file
问题描述
在我的代码中没有进行任何更改,当我尝试运行我的应用程序时,突然出现此错误:
Without any changes in my code, suddenly i get this error when I try to run my app:
- 出了什么问题: 任务':app:packageDebug'的执行失败. com.android.builder.packaging.PackagerException:java.io.IOException:无法读取zip文件"C:\ Users \ Eliran \ AndroidStudioProjects \ Forum \ app \ build \ outputs \ apk \ app-debug.apk".
- What went wrong: Execution failed for task ':app:packageDebug'. com.android.builder.packaging.PackagerException: java.io.IOException: Failed to read zip file 'C:\Users\Eliran\AndroidStudioProjects\Forum\app\build\outputs\apk\app-debug.apk'.
我不知道为什么它试图将apk读取为zip文件.
I have no idea why its trying to read the apk as zip file.
- 如果我重新启动Android Studio,则可以运行一次该应用,然后再次发生.
推荐答案
对我来说,当我Exit Android Studio
时(现在)它会有所帮助,接下来我使用Windows Task Manager
(Ctrl + Shift + Esc)并终止进程Java(TM) Platform SE binary
并手动删除该文件.之后,我再次运行Android Studio,单击Clean Project
(app:clean可能存在错误,但是您可以再次运行Android Studio),然后单击Make Project
-当然在Android中单击Run 'app'
按钮之后工作室.
For me it helps (for now) when I Exit Android Studio
, next I used Windows Task Manager
(Ctrl + Shift + Esc) and kill process Java(TM) Platform SE binary
and delete that file manually. After that I run Android Studio again, click on the Clean Project
(there can be an error with app:clean, but you can run Android Studio again) and next click Make Project
- after that of course Run 'app'
button in Android Studio.
这篇关于任务':app:packageDebug'的执行失败-无法读取zip文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!