Android Studio : Operation is not supported for read-only collection
Asked Answered
G

5

9

I just update to Android Studio HedgeHog and for any project I have this message when compiling :

"Operation is not supported for read-only collection"

It does not start compilation, it displays this message directly.

I am on Windows 11 pro.

I tried :

  • invalid cache / restart
  • create new projet in same/other default folder
  • reinstall from scratch android studio

It worked by previous version of Android Studio Girafe.

Gustafsson answered 1/12, 2023 at 8:52 Comment(2)
Yes ! Menu -> File -> Manage IDE Settings -> Restore Default Settings.. worked for me !Gustafsson
I have the same problem and I tried all the solutions, but the problem is still existMailbox
M
9

I solved it by unchecking this in the Experimental Configs.

Settings > Experimental > Trace Gradle Import with profile

If that doesn't work, try to uncheck other experimental options.

Midi answered 7/12, 2023 at 16:29 Comment(0)
S
7

I Did Menu -> File -> Manage IDE Settings -> Restore Default Settings...

After restart and reinitializion of Android Studio, opened project again and it's working OK now.

Update: This will reset all settings and plugins. Try with other solutions first like disabling "Trace Gradle Import with profile" before doing that.

Shurlock answered 1/12, 2023 at 10:34 Comment(6)
For me this is not working! do you have other option, I have tried everything from answers in this post but none is working. If i use canary build it is working thoughPalma
Sorry, not. Had problems for long time, and this helped me. Other answer with trust location could be also possible solution.Shurlock
I just deleted my android studio seetings from appdata folder, which created entirely new AS settings and it worked.Palma
This works for me. Basically you have to reset Android Studio and make sure it asks you if to trust the project you want to open.Motteo
Wow, I tried all other options, but none of them worked. Your suggestion worked like a charm! ThanksDialectics
your suggestion worked, thanksMillican
A
6

Go to "Android Studio -> Files -> Settings -> Experimental" and disable the "Trace Gradle with the Import" check box. This occurred after updating to Hedgehog.

Screenshot

Apps answered 19/12, 2023 at 18:19 Comment(0)
C
0

It looks like that is because the project had been imported from the previous version of the Android Studio, but the studio did not suggest 'trust' it.

Go to File -> Settings -> Build, Execution, Deployment -> Trusted Locations and add the project's parent folder to the trusted locations list.

If that didn't help, try to re-import the project (make sure that parent directory is added to trusted locations).

Cutin answered 1/12, 2023 at 10:54 Comment(0)
C
0

I have tried all means suggested by the above posts, none of them work for me. Stupid upgrading has to restore back to the previous version.

Carving answered 26/2 at 4:1 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Planospore

© 2022 - 2024 — McMap. All rights reserved.