Android studio 3 beta 4. Refactoring cannot be performed

1.7k views Asked by At

I have a problem with the latest beta update trying to refactor the view or xml layout name id in xml. The error dialog says

Refactoring cannot be performed File C:\dev\workspace......\R.java is read-only.

Things I've tried:
Gradle clean, Invalidate cache/restart. None helped. I also tested with strings and other resources. The same problem happens there.

The problem appeared in the beta 4 update. In beta 2 refactoring worked fine.

2

There are 2 answers

1
JavierSegoviaCordoba On

Android Studio Beta 5 has solved this problem.

0
Dexter On

I am experiencing the same issue on Android Studio 3.0 Beta 5 and 6. If your R.java file is read-only and your package name is com.example.sample just remove the file app/build/generated/source/r/debug/com/example/sample/R.java (R.java,Manifest.java...), then try again when you're finished refactoring, it will be regenerated during the build process.