Reputation: 152
When I compile my app in order to run it on the emulator, Android Studio (version 3.0 RC2) complains because it can't delete the 1.jar file inside my project folder.
Here is the error message:
Error:Execution failed for task ':app:transformClassesWithDesugarForDebug'.
> com.android.build.api.transform.TransformException: java.io.IOException:
Could not delete path 'D:\ProgrammazioneOffline\ProjectFolder\app\build\intermediates\transform
s\desugar\debug\1.jar'.
I found that cleaning the project makes it compile again but after a while it complains again. My project is not that small and rebuilding all every time takes a lot of time (around 4 mins when rebuilding all compared to 30 second when it works fine).
I had formatted my PC and changed the project's path before the problem appeared. Did I forget to chenge some references to the project somewhere?
I did not find this issue in the knows issues.
Thanks in advance and sorry for my bad English.
EDIT: I found out that the file is being used by java.exe and killing it via cmd makes the compilation run but shouldn't it be done by Android Studio?
EDIT2: It was the firebase plugin, the issue has been fixed, see my accepted answer
Upvotes: 12
Views: 5945
Reputation: 29
Faced this many times,just rebuild your project and check the error message that android studio is displaying and remember the file name that android studio is asking to delete,after then go manually to that file like :C/users/youruser/androidstudioprojects/.../ find that file and delete it manually after then go back to android studio and clean the project this time you won't get error....
Hope This Help..
Upvotes: 1
Reputation: 1
just open the project location. find your file which is not deleting. if you try to delete that single file it won't .so just copy all other files which should not be deleted and delete the whole file which you wanted to be deleted eg:drawable: Ob_photo //(i must delete this file)as file name should not be a capital letter
ic_photo2
delete whole drawable file copying ic_photo2
Upvotes: 0
Reputation: 152
It seems that now the issue has been fixed. Update your firebase-perf plugin to version 1.1.4+ ('com.google.firebase:firebase-plugins:1.1.4') and your firebase dependencies to version 11.6.0+.
Thanks to anyone who answered the question.
Source: https://issuetracker.google.com/issues/68316213
Upvotes: 0
Reputation: 322
The google team realized that one of the causes is the firebase performance plugin. Remove it if you have it.
Upvotes: 1
Reputation: 322
Another chance is temporarily disable desugaring and bring back retrolambda until the bug will be fixed.
Upvotes: 1
Reputation: 444
Maybe your jar is still running when you try to re compile?
If so your system cannot delete is since it's being used
Upvotes: 1