【问题标题】:Android studio show incorrect contentAndroid Studio 显示不正确的内容
【发布时间】:2020-08-28 16:02:52
【问题描述】:

我在 Android studio 4.0 稳定版上开发了一个 Flutter 应用。最近,当我打开一个文件时,它会显示一些奇怪的 xml 内容。但是,当我在另一个编辑器(例如记事本)中打开同一个文件时,它会显示我想要的内容。

注意:这种情况只发生在某些文件中。

这是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">
....

这是另一个编辑器上的内容:

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);
    }
  }

【问题讨论】:

    标签: android android-studio flutter


    【解决方案1】:

    我认为这是来自 git 版本控制的错误。从其他编辑器复制代码粘贴到 android studio 中它会起作用。一个月前我受到影响,我就这样解决了,然后它就自动消失了。

    【讨论】:

      猜你喜欢
      • 2021-10-24
      • 2014-07-27
      • 1970-01-01
      • 2019-04-09
      • 2021-10-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多