Eliran Tutia
Eliran Tutia

Reputation: 736

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:

  • 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'.

I have no idea why its trying to read the apk as zip file.

Upvotes: 23

Views: 26817

Answers (7)

Al Galib
Al Galib

Reputation: 1

1.delete debug.keystore file

C:\Users\xxx\.android\debug.keystore
  1. flutter clean
  2. restart ide

Upvotes: 0

Rajarshi Barman
Rajarshi Barman

Reputation: 51

If you are using flutter, type

flutter clean

and restart your ide. It worked for me.

Upvotes: 1

Anand_5050
Anand_5050

Reputation: 1159

After wasting my 4 hours i could fix this.

I fixed it by deleting ~/.android/debug.keystore file.

Upvotes: 0

Shohel Rana
Shohel Rana

Reputation: 2342

Its solve my problem perfectly. i Just delete my build file and file>> Invalidate and restart android studio. This problem occur for me change dependency version

Upvotes: 4

Prabhat
Prabhat

Reputation: 76

just delete debug.keystore file under .android

Upvotes: -7

y07k2
y07k2

Reputation: 2052

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.

Upvotes: 9

leus
leus

Reputation: 99

I try manual delete file, but the SO inform: the file "app-debug.apk" is in use by "OpenJDK Platform Binary". Then I kill "OpenJDK Platform Binary" and this worked.

Upvotes: 3

Related Questions