android - Andriod Build问题无法解析XML

我在清单文件的android应用程序中遇到构建问题,出现以下错误:

错误:无法在[row,col]:[42,5]处解析D:\\ TA Android \\ TAApp \\ app \\ src \\ main \\ AndroidManifest.xml ParseError中的XML消息:预期的开始或结束标记受影响的模块:app

我在给定的行号中看不到任何错误,有人可以帮我解决什么问题吗?

Gradle文件:

    apply plugin: 'com.android.application'

    android {
        compileSdkVersion  29
        buildToolsVersion  "29.0.1"
        project.archivesBaseName = "MassC";
        defaultConfig {
            applicationId "com.example"
            minSdkVersion 15
            targetSdkVersion 29
            versionCode 1
            versionName "2.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.0.2'
        implementation 'com.google.android.material:material:1.0.0'
        implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
        implementation 'androidx.annotation:annotation:1.1.0'
        implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'androidx.test:runner:1.2.0'
        androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
        implementation 'com.squareup.retrofit2:retrofit:2.3.0'
        implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
        implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'

    }

清单文件

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.ta_app_ui">
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.INTERNET" />

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

    <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=".ui.signup.SignupActivity"></activity>
        <activity
            android:name=".ui.login.LoginActivity"
            android:label="@string/title_activity_login">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".ui.sidebar.MainActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar"></activity>
        <activity
            android:name=".ui.candidate_details.ViewUserDataActivity"
            android:parentActivityName=".ui.sidebar.MainActivity">

            <!-- The meta-data tag is required if you support API level 15 and lower -->
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".ui.sidebar.MainActivity" />
        </activity>
        android:label="@string/app_name"
    </application>

</manifest>


When I try to build ,I get error as Failed to Parse XML  in ...path..\AndriodManifest.xml ParseError

----Snippet----

在此处输入图片说明

最后,从您的Manifest.xml中删除android:label="@string/app_name" 完整的xml应该是这样的:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.ta_app_ui">
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.INTERNET" />

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

    <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=".ui.signup.SignupActivity"></activity>
        <activity
            android:name=".ui.login.LoginActivity"
            android:label="@string/title_activity_login">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".ui.sidebar.MainActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar"></activity>
        <activity
            android:name=".ui.candidate_details.ViewUserDataActivity"
            android:parentActivityName=".ui.sidebar.MainActivity">

            <!-- The meta-data tag is required if you support API level 15 and lower -->
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".ui.sidebar.MainActivity" />
        </activity>
    </application>

</manifest>

只需从清单文件中删除android:label =“ @ string / app_name”就可以了

转载请注明来自askonline.tech,本文标题:android - Andriod Build问题无法解析XML


 Top