flutter-intellij icon indicating copy to clipboard operation
flutter-intellij copied to clipboard

Android studio writes Dart code inside XML files

Open tolotrasamuel opened this issue 7 years ago • 12 comments

Steps to Reproduce

When I open styles.xml or AndroidManifest.xml I see Dart codes. This happens sporadically and I am still trying to figure out when exactly it happens. It happened 3 times so far at random point.

image

Version info

[√] Flutter (Channel stable, v1.0.0, on Microsoft Windows [Version 10.0.17134.590], locale en-MU) [√] Android toolchain - develop for Android devices (Android SDK 28.0.3) [√] Android Studio (version 3.3) [√] Connected device (1 available)

tolotrasamuel avatar Feb 26 '19 18:02 tolotrasamuel

Thanks for the report! We haven't gotten other reports of this, so I'm curious how it's happening. Please let us know as you get more details.

devoncarew avatar Feb 26 '19 19:02 devoncarew

Have you enabled the experimental option to make code completion, etc. work for Java code in the Android module? If not, I'd recommend opening the Android module in a new project to edit files in the 'android' directory. Just click the Open for editing in Android Studio button in the screenshot.

Did the Dart code completely replace the original XML content? Is there any chance a spurious keyboard command may have gotten processed by the XML editor?

stevemessick avatar Feb 26 '19 21:02 stevemessick

Without additional information we're unfortunately not sure how to resolve this issue. We're going to close this bug for now, but please don't hesitate to comment on the bug if you have any more information for us; we're happy to reopen. Thanks for your contribution!

no-response[bot] avatar Mar 15 '19 00:03 no-response[bot]

Without additional information we're unfortunately not sure how to resolve this issue. We're going to close this bug for now, but please don't hesitate to comment on the bug if you have any more information for us; we're happy to reopen. Thanks for your contribution!

no-response[bot] avatar Mar 15 '19 00:03 no-response[bot]

Steps to Reproduce When I open xml or .java i see Dart codes. Close or uninstall,but i see Dart codes.This happens sporadically and I am still trying to figure out when exactly it happens. Version info [√] Flutter (Channel dev, v1.8.1, on Microsoft Windows [Version 10.0.14393], locale zh-CN) [√] Android toolchain - develop for Android devices (Android SDK version 28.0.3) [√] Android Studio (version 3.4) [√] Android Studio (version 3.2) [√] VS Code, 64-bit edition (version 1.32.3) [√] Connected device (1 available)

xtfgq avatar Jul 19 '19 07:07 xtfgq

Currently something similar happens to me, and it happens randomly. Instead of Dart code, XML appears. I was forced to use VSC. capture

yavac avatar Aug 13 '19 17:08 yavac

I got the same problem as above. When I opened my flutter project, there was a popup "Android Framework is detected". I clicked on 'Configure' link and it overwrote dart files with XML.

I removed the project from Android studio, deleted .idea folder inside the project and re-imported the project but issue was still there. Issue did not resolve with 'Invalidate Cache/Restart' option either.

Then I again removed the project, deleted .idea and .AndroidStudio folder and re-imported, this time it worked. I lost all custom settings and had to reinstall flutter and dart plugins.

YPBS avatar Nov 21 '19 20:11 YPBS

Currently something similar happens to me, and it happens randomly. Instead of Dart code, XML appears. I was forced to use VSC. capture

I have the same problem! I just can't understand why does this actually happen! Anybody has some suggestion for me ?

stevenosse avatar Dec 14 '19 18:12 stevenosse

I have the same problem. Because I have plugged flutter.

jvlichai avatar Feb 21 '20 16:02 jvlichai

i have the same problem and i was forced to use vsc , anybody knows why this is happening ?

Currently something similar happens to me, and it happens randomly. Instead of Dart code, XML appears. I was forced to use VSC. capture

I have the same problem! I just can't understand why does this actually happen! Anybody has some suggestion for me ?

tharwatsamy avatar May 01 '20 15:05 tharwatsamy

i have the same problem and i was forced to use vsc , anybody knows why this is happening ?

Currently something similar happens to me, and it happens randomly. Instead of Dart code, XML appears. I was forced to use VSC. capture

I have the same problem! I just can't understand why does this actually happen! Anybody has some suggestion for me ?

it was solved after resetting android studio

tharwatsamy avatar May 01 '20 16:05 tharwatsamy

1629869410038 i also got xml file instead of dart code in android studio.

acharyabro123 avatar Sep 10 '21 15:09 acharyabro123