I recently updated my Android project's gradle plugin to 2.1.0
from 2.1.0-alpha4
. But now I see that all my builds fail with a message like so:
Error:Execution failed for task ':App:compileUpdemoDebugJavaWithJavac'.
> Could not expand ZIP '/Users/admin/work/app/libs/lib-android-0.11.0.jar'.
If I revert my gradle plugin to the previous 2.1.0-alpha4
version, set the environment variable ANDROID_DAILY_OVERRIDE
and then build my project — everything works just fine.
Has anyone else come across this problem? I believe this is related to the latest plugin, and so, people might just start to stumble across this problem.
Any possible solutions? (I am aware of some workarounds, like extracting the JAR and making gradle skip the JAR extraction process, but that certainly doesn't sound worth the effort!)
Follow below step to set automatically gradle sync in your android studio.
File -> Settings -> Build,Execution,Deployment ->Build tools -> gradle -> check Use Default gradle wrapper(recommended) radiobutton.
Also follow below step to restart your android studio for invalid cache restart.
File > Invalidate Caches/Restart (you can also manually remove the cache at ~/Library/Caches/{yourIDEName} and restart the IDE)
Then save settings and rebuild your project.
Unfortunately, most of the answers posted here didn't work out. Although, logically speaking, @Kowshick's answer seemed to tackle the right thing — i.e, there's something wrong with the directory permissions. However, giving 777
access can't be the right thing, and the default 755
that I had on my development folder, sdk folder, build folder — should've worked just fine. But it didn't. :(
Eventually, what I realised is that there are only 3 ways to resolve this problem:
2.0.0
. The very fact that it works by downgrading, shows that the real issue isn't with the directory permissions I have.In my case, I survived using option # 2 for some time, and I was just lucky that I had my hard drive upgraded to an SSD, so I finally ended up doing option # 3 too (since I made a fresh install of my OS on the SSD).
Other info:
OS — OS X (El Capitan)
Android studio — 2.1.0
From what I can see your project is in admin directory /Users/admin/work/app/libs/lib-android-0.11.0.jar.
1) Either you could try moving your project path to some user directory,like /home/username/
2) Or you could give write permission to you project path by using
sudo chmod 777 -R /Users/admin/work/app/
Guess this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With