首页 > 解决方案 > Android Studio XML Parse 错误:prolog 中不允许内容

问题描述

我将编码 utf-8 的清单文件更新为 utf16。经过一些更改,我想返回 utf-8 但我现在有这个错误。我不知道我能做什么?我清理项目并重建但没有解决。我把我的清单 xml 和 build.gradle(app)

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.example.imdbfilm">

    <uses-permission android:name="android.permission.INTERNET"/>

    <application
        android:name=".MyApplication"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name=".MainActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            tools:ignore="WrongManifestParent">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".FilmOzellikleri" />
    </application>
</manifest>
    //无检查 GradleCompatible
    应用插件:'com.android.application'
    应用插件:'realm-android'
    安卓 {
        compileSdkVersion 29
        构建工具版本“29.0.2”
        默认配置 {
            applicationId "com.example.imdbfilm"
            minSdkVersion 23
            targetSdkVersion 29
            版本代码 1
            版本名称“1.0”
            testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        }
        构建类型 {
            发布 {
                缩小启用假
                proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            }
        }
    }

    依赖{
        实现文件树(目录:'libs',包括:['*.jar'])
        //实现'androidx.appcompat:appcompat:1.1.0-rc01'
        //无检查 GradleCompatible
        实施 'com.android.support:appcompat-v7:27.0.2'
        实现'androidx.constraintlayout:constraintlayout:2.0.0-beta2'
        testİmplementation 'junit:junit:4.13-beta-3'
        androidTestİmplementation 'androidx.test:runner:1.3.0-alpha02'
        androidTestİmplementation 'androidx.test.espresso:espresso-core:3.3.0-alpha02'
        //无检查 GradleCompatible
        实施 'com.android.support:recyclerview-v7:28.0.0'
        实施 'com.squareup.okhttp:okhttp:2.7.5'
        实现 'androidx.cardview:cardview:1.0.0'
        实现 'androidx.gridlayout:gridlayout:1.0.0'
        实现'androidx.legacy:legacy-support-v4:1.0.0'
    }

标签: androidxmlxml-parsingrealm

解决方案


推荐阅读