错误:无法解析AndroidManifest.xml中的XML

时间:2020-05-26 06:07:27

标签: android

今天重启我的android studio时出现错误:

ERROR: Failed to parse XML in C:\Users\Jimzyeow\AndroidStudioProjects\NewsFeedApplication\app\src\main\AndroidManifest.xml
ParseError at [row,col]:[19,9]
Message: expected start or end tag
Affected Modules: app

这是我的AndroidManifest.xml。 android:theme =“ @ style / Base.Theme.AppCompat”以红色突出显示,并说“验证Android XML文件中的资源引用”

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

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

    <application
        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=".ChatActivity"
            android:parentActivityName=".MainActivity">
            android:parent
        </activity>
        <activity android:name=".ParentsActivity" />
        <activity android:name=".ParentsProfileActivity" />
        <activity android:name=".CommentsActivity" />
        <activity
            android:name=".FindParentsActivity"
            android:parentActivityName=".MainActivity" />
        <activity android:name=".ProfileActivity" />
        <activity
            android:name=".SettingsActivity"
            android:parentActivityName=".MainActivity" />
        <activity android:name=".ClickPostActivity" />
        <activity android:name=".SetupActivity" />
        <activity android:name=".LoginActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".RegisterActivity" />
        <activity android:name=".PostActivity" />
        <activity android:name=".MainActivity" />
        <activity
            android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
            android:theme="@style/Base.Theme.AppCompat" />
    </application>

</manifest>

这是我的应用程序

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.3"
    defaultConfig {
        applicationId "com.example.newsfeedapplication"
        minSdkVersion 19
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation 'androidx.recyclerview:recyclerview-selection:1.1.0-rc01'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

    implementation 'com.google.firebase:firebase-database:19.2.1'
    implementation 'com.google.firebase:firebase-auth:19.3.0'
    implementation 'com.google.firebase:firebase-storage:19.1.1'
    implementation 'com.firebaseui:firebase-ui-database:6.2.1'

    implementation 'com.google.android.material:material:1.2.0-alpha06'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'de.hdodenhof:circleimageview:3.1.0'
    implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.+'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

2 个答案:

答案 0 :(得分:2)

尝试删除android:parent行:

<activity android:name=".ChatActivity"
        android:parentActivityName=".MainActivity">
        android:parent
</activity>

如下所示:

<activity android:name=".ChatActivity"
        android:parentActivityName=".MainActivity">
</activity>

答案 1 :(得分:2)

    <activity android:name=".ChatActivity"
        android:parentActivityName=".MainActivity">
        **android:parent**
    </activity>

声明ChatActivity时,您的属性 android:parent

不完整