Can't rename resource (layout) files (Android Studio 3.0 Beta 3 is installed)

后端 未结 4 1626
予麋鹿
予麋鹿 2021-02-11 18:52

Beta 3 doesn\'t allow to rename resource files such as layout files. It does show the renaming dialog, but when trying to apply changes it reads the following error message:

4条回答
  •  被撕碎了的回忆
    2021-02-11 19:21

    I am experiencing the same issue on Android Studio 3.0 Beta 3. I fixed the problem by:

    1. Exiting Android Studio
    2. Navigating to the folder that the layout file is saved in (either CLI or GUI)
    3. Rename the file to whatever you want the refactored file to be called.
    4. Reopen Android Studio.

    Obviously this forces you to have to manually refactor the references to the old file, but I tried about a dozen different things (changing R.java permissions, Gradle clean, invalidate cache, etc.) and none of them worked.

    Anyone else who has this issue should submit this bug in Android Studio by using Help > Submit Feedback.

    Also, is there a chance you might also be using multiple layouts folders like I am?

提交回复
热议问题