apollo-kotlin: java.io.IOException: Unable to delete file
Version: 1.0.0-alpha5
OS: Windows 10
Everytime I try to compile my app, I get this error (see image) due to :app:installApolloCodegen
trying to delete package.json
.
How do I prevent this from happening? It happens constantly. Current work-around is to manually delete it in file explorer. Then try to rerun compilation.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 17 (3 by maintainers)
A better workaround that I have found is to use the global version of
apollo-codegen
. You can simply install it with:as it says in the docs and then create a
gradle.properties
file in your home folder usuallyC:\Users\<USERNAME>\.gradle\
with the line:This way it will not attempt to delete the file constantly, but you can still put the project in version control. Your non-windows team mates will not have the need to install apollo-codegen globally (assuming this problem only exists on Windows)
Having the same issue. Using ‘com.apollographql.apollo:apollo-runtime:1.0.0’, on Windows 10 with Android studio 3.4.1. Have read/write access to file. Clean doesn’t work.
We might get a fix of this issue via https://github.com/apollographql/apollo-android/pull/1338