Android studio show incorrect content

Viewed 112

I developed a flutter application on Android studio 4.0 stable version. And recently when I open a file it shows me some weird xml content. But, when I open this same file in another editor, for example notepad, it shows the content I wanted.

Note: This happens with some files only.

Here is the content of file on Android studio:

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="4889ab26-e611-4faf-b916-177fd1a6b8c2" name="Default Changelist" comment="" />
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
    <option name="LAST_RESOLUTION" value="IGNORE" />
  </component>
  <component name="ExecutionTargetManager" SELECTED_TARGET="Pixel_3_API_24" />
  <component name="FileTemplateManagerImpl">
    <option name="RECENT_TEMPLATES">
      <list>
        <option value="Dart File" />
      </list>
    </option>
  </component>
  <component name="FlutterView" splitter-proportion="0.71693736" />
  <component name="ProjectId" id="1eAMKATNRfB7qc5vPnqjujX7lm5" />
  <component name="ProjectViewState">
    <option name="hideEmptyMiddlePackages" value="true" />
    <option name="showExcludedFiles" value="true" />
    <option name="showLibraryContents" value="true" />
  </component>
  <component name="PropertiesComponent">
    <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
    <property name="dart.analysis.tool.window.force.activate" value="false" />
    <property name="io.flutter.reload.alreadyRun" value="true" />
    <property name="last_opened_file_path" value="$PROJECT_DIR$/../../MAD-level_1_SHP.zip" />
    <property name="settings.editor.selected.configurable" value="reference.settingsdialog.IDE.editor.colors.Color Scheme Font" />
    <property name="show.migrate.to.gradle.popup" value="false" />
  </component>
  <component name="RecentsManager">
    <key name="CopyFile.RECENT_KEYS">
....

Here is the content on another editor:

class AuthenticationBloc extends Bloc<AuthenticationEvent, AuthenticationState> {
  final UserRepository userRepository;
  final DataConnectionChecker dataConnectionChecker;

  AuthenticationBloc({@required this.userRepository, @required this.dataConnectionChecker})
      : assert(userRepository != null),
        assert(dataConnectionChecker != null),
        super(AuthenticationInitial());

  @override
  Stream<AuthenticationState> mapEventToState(
    AuthenticationEvent event,
  ) async* {
    if (event is AuthenticationStarted) {
      yield* _mapAuthenticationStartedToState(event);
    }

    if (event is AuthenticationAuthorizedIn) {
      yield* _mapAuthenticationAuthorizedInToState(event);
    }

    if (event is AuthenticationLoggedOut) {
      yield* _mapAuthenticationLoggedOutToState(event);
    }
  }
1 Answers

It's a bug I think coming from git version control. Copy the code from other editor paste in android studio it will work. I was affected a month ago and I solved in that way and after that it was automatically gone.

Related