Android Studio file is showing as decompiled .class file and it is read only

  android-studio, java

We use .txt files in our res/raw folder for our database updates. Each file is an update to the database and incremented in the title. For instance:

database_100

database_101

Then, when the app is ran and a database is built, it increments through until the one we tell it to. I don’t usually add these files, but am trying to add one now. When I add database_135 it opens with a red line at the top saying Decompiled .class file and when I try to type into it, it says File is read-only.

From searching, here is what I have found and it isn’t working so far:

  • I have checked the lock in the lower right and it shows unlocked, but locking and unlocking doesn’t do it.
  • I tried File>Make File Writeable, but instead of it saying that, it says Make File Read-Only. Again, flipping it Read-Only and then Writeable doesn’t do it.
  • I tried Invalidate Caches / Restart and that still didn’t work.
  • I tried adding a file called database_135 in the repo manually (outside Android Studio) and while that works (the file is added and I can see it in Android Studio), it still shows the same thing when I open it and try to edit it.
  • My lead has no issue creating the file and editing it. We decided to have him upload the file to the origin, but after pulling the changes, I still get the same issue.

I am, however, able to create the next file. So, I can create a file called database_136 and everything is editable and I can do what I need. Everything is the exact same (environment, filetype, etc.) except the name. We can’t figure out what the issue is with that one name. I can have my lead add the changes and upload to the origin, but I want to make sure I figure this out in case there is another number that I come across.

Have you seen this before?

Source: Android Studio Questions

One Reply to “Android Studio file is showing as decompiled .class file and it is read only”

LEAVE A COMMENT