standard development for flutter, somehow android studio decided every file was read only (which was not the case). seems clearing .idea directories fixed the issue. but this sort of behavior isn't acceptable.
begging that flutter move away from android studio as the defacto development environment. its extremely fragile and brittle. to the point where everytime I've tried to use android studio I spend more time debugging the IDE than actually writing code.
[✓] Flutter (Channel beta, v1.0.0, on Linux, locale en_US.UTF-8)
• Flutter version 1.0.0 at ${HOME}/development/flutter
• Framework revision 5391447fae (3 weeks ago), 2018-11-29 19:41:26 -0800
• Engine revision 7375a0f414
• Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
• Android SDK at ${HOME}/Android/Sdk
• Android NDK at ${HOME}/Android/Sdk/ndk-bundle
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = ${HOME}/Android/Sdk
• Java binary at: ${HOME}/development/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
• All Android licenses accepted.
[✓] Android Studio (version 3.2)
• Android Studio at /opt/android-studio
• Flutter plugin version 31.3.1
• Dart plugin version 181.5656
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
[✓] Android Studio (version 3.2.)
• Android Studio at ${HOME}/development/android-studio
• Flutter plugin version 31.3.1
• Dart plugin version 181.5656
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
[✓] Connected device (2 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)
• No issues found!
Sorry you had this experience. It would be great for us to track down what happened so please do share whatever context you can. Certainly if this recurs...
begging that flutter move away from android studio as the defacto development environment. its extremely fragile and brittle. to the point where everytime I've tried to use android studio I spend more time debugging the IDE than actually writing code.
Again, this is really unfortunate. If you have any actionable feedback we can pass on to the Android Studio team we'd be happy to.
Thanks again for the report and do check back if you hit any other issues.
Flutter plugin version 31.3.1
~PS: we've had a few quick releases of the flutter plugin since 31.3.1 to address a number of issues. Worth an update for sure...~
EDIT: Sorry, misread. You're up to date.
/cc @devoncarew @stevemessick @alexander-doroshko FYI
problem is I'm not even sure how to debug these issues. android studio is extremely opaque regarding errors.
android studio is extremely opaque regarding errors.
@alexander-doroshko : any suggestions that may help debug AS in general?
To narrow down the "read-only mode" problem I'd first ask what the problem looks like.
Was it a dialog saying 'You are trying to edit non-project file. Are you sure?'? If so then it means that the project structure somehow got messed up and the files appeared to be outside of the configured content roots.
The root cause might be the same as in #2993. My guess is that it could be related to Gradle. I'm not an expert in Gradle, neither in its support in the IDE. Just a guess: on Gradle project reimport all the current IDE project configuration is wiped out and reconfigured from scratch based on gradle config file. So content roots might be changed as well as module dependencies, which means that knowledge that that was a Flutter project gets lost.
The cause might be different.
@alexander-doroshko the read only mode presented itself when editing the files themselves. AS would just ignore my input and display a little note saying read only. i 'fixed' the issue by deleting gradle and .idea caches. havent been able to reproduce it. #2993 still happens all the time though.
the read only mode presented itself when editing the files themselves. AS would just ignore my input and display a little note saying read only.
Not sure I understand. Should you see it again please paste a screenshot. Thanks!
Speaking of #2993, Gradle reimport is probably deleting knowledge about Flutter from the IDE project files. Gradle doesn't know anything about Dart/Flutter, so maybe Flutter projects shouldn't be backed by Gradle config. Sorry, not my area of expertise. Not sure I can help much with it. I think responsible developers might be interested in a sample project they could use to reproduce the issue.
Since no one ever provided you with a screen shot here it is. Every file in Android Studio is locked, I cannot edit anything. BTW I know that the res definitions as shown in this example are wrong, I was working on fixing the issue when I suddenly am no longer able to edit any file.
The little popup message happens on any edit action, such as hitting enter or any other character.

I continue to have this issue. Have tracked it down in Android Studio 3.3.2 to when I go to Open Module Settings (F4) and I create the APK module, press Apply, and then Ok all of my files are now locked with Android Studio.
To restore my ability to edit the project I have to Re-import Gradle Project. But as soon as I do that I loose all of my "Modules" that I created using the Open Module Settings (F4) window.
Please file this bug report at https://github.com/flutter/flutter-intellij/issues/new.
trying to edit file in dart
Android Studio 3.4 • Flutter plugin io.flutter 35.0.1 • Dart plugin 183.6270
Flutter 1.2.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 8661d8aecd (3 months ago) • 2019-02-14 19:19:53 -0800
Engine • revision 3757390fa4
Tools • Dart 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)
null
com.intellij.openapi.editor.ReadOnlyModificationException: Attempt to modify read-only document
at com.intellij.openapi.editor.impl.DocumentImpl.replaceString(DocumentImpl.java:635)
at com.intellij.openapi.editor.impl.DocumentImpl.replaceString(DocumentImpl.java:625)
at io.flutter.editor.FlutterSaveActionsManager$3.run(FlutterSaveActionsManager.java:175)
at com.intellij.openapi.command.WriteCommandAction$Simple.run(WriteCommandAction.java:348)
at com.intellij.openapi.application.RunResult.run(RunResult.java:35)
at com.intellij.openapi.command.WriteCommandAction.lambda$null$1(WriteCommandAction.java:264)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1057)
at com.intellij.openapi.command.WriteCommandAction.lambda$performWriteCommandAction$2(WriteCommandAction.java:263)
at com.intellij.openapi.command.WriteCommandAction.lambda$doExecuteCommand$4(WriteCommandAction.java:321)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:220)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:188)
at com.intellij.openapi.command.WriteCommandAction.doExecuteCommand(WriteCommandAction.java:323)
at com.intellij.openapi.command.WriteCommandAction.performWriteCommandAction(WriteCommandAction.java:262)
at com.intellij.openapi.command.WriteCommandAction.execute(WriteCommandAction.java:244)
at io.flutter.editor.FlutterSaveActionsManager.lambda$performFormat$1(FlutterSaveActionsManager.java:189)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:315)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:435)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:419)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:403)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
at java.awt.EventQueue.access$500(EventQueue.java:98)
at java.awt.EventQueue$3.run(EventQueue.java:715)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:755)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:704)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:391)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Hey,
I've the same issue and need urgent help for that
@mekhti This happens due to file being set as read only via editor
unlock the file by clicking lock icon in bottom right
This issue is STILL happening. I would really appreciate a fix. I am spending more time uninstalling and reinstalling IDE's than developing. And no, the lock icon to writeable does note work.
Hey, dont leave flutter for an editor use VSCODE for flutter if
android studio locks downs files or even create your flutter app and
bundle it seperately
On 15/05/2019, H-Donaldson notifications@github.com wrote:
This issue is STILL happening. I would really appreciate a fix. I am
spending more time uninstalling and reinstalling IDE's than developing. And
no, the lock icon to writeable does note work.--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/flutter/flutter-intellij/issues/2994#issuecomment-492453085
Now I'm forced to use VSCode also if Android Studio has more utilities. Why is this still unsolved?
same issue on version 3.4.2. This solved it.
- Close Android Studio.
- Save .idea folder for future restore (if something happend)
- Remove .idea folder
- Start Android Studio and open project.
thanks Karlheinzniebuhr
Most helpful comment