简体   繁体   English

Gradle构建完成,AndroidManifest.xml中出现错误(错误:任务':app:processDebugManifest'的执行失败。)

[英]Gradle build finished with error in AndroidManifest.xml (Error:Execution failed for task ':app:processDebugManifest'.)

Gradle build is unsuccessful with following error. Gradle构建失败,并出现以下错误。

Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(26.0.0) from [com.android.support:design:26.0.0] AndroidManifest.xml:28:13-35is also present at [com.android.support:appcompat-v7:26.1.0] AndroidManifest.xml:28:13-35 value=(26.1.0).Suggestion: add 'tools:replace="android:value"' to element at AndroidManifest.xml:26:9-28:38 to override 清单合并失败:[com.android.support:design:26.0.0]中的属性meta-data#android.support.VERSION@value value =(26.0.0)也位于[ com.android.support:appcompat-v7:26.1.0] AndroidManifest.xml:28:13-35 value =(26.1.0)。建议:在AndroidManifest的元素上添加'tools:replace =“ android:value”'。 xml:26:9-28:38覆盖

I am not able to find the bug. 我找不到错误。 My gradle version is 3.0.1. 我的gradle版本是3.0.1。 My AndroidManifest.xml file is below. 我的AndroidManifest.xml文件在下面。 Please help! 请帮忙!

 <?xml version="1.0" encoding="utf-8"?>
        <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.example.vmac.WatBot">
        <uses-permission android:name="android.permission.INTERNET" />
        <uses-permission 
        android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
        <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
        <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
      <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
      <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
        <uses-permission android:name="android.permission.RECORD_AUDIO"/>

        <application
            android:allowBackup="true"
            android:icon="@mipmap/ic_face"
            android:label="@string/app_name"
            android:supportsRtl="true"
            android:theme="@style/AppTheme">
            <activity
                android:name=".MainActivity"
                android:screenOrientation="portrait">
            </activity>
            <activity android:name=".SplashActivity"
                android:screenOrientation="portrait"
                android:theme="@style/SplashTheme">>
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />

                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
        </application>

    </manifest>

Here is my build.gradle file 这是我的build.gradle文件

apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
    applicationId "com.example.vmac.chatbot"
    minSdkVersion 21
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
    testInstrumentationRunner 
"android.support.test.runner.AndroidJUnitRunner"

}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 
'proguard-rules.pro'
    }
}
lintOptions {
    abortOnError false
    }
}

dependencies {


// Automatically pulls in core SDK

compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:26.1.0'


androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', 
{
    exclude group: 'com.android.support', module: 'support-annotations'
})

implementation 'com.android.support:appcompat-v7:26.0.0'
implementation 'com.android.support:recyclerview-v7:26.0.0'
implementation 'com.android.support:design:26.0.0'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'com.ibm.watson.developer_cloud:conversation:4.2.1'
implementation 'com.ibm.watson.developer_cloud:text-to-speech:4.2.1'
implementation 'com.ibm.watson.developer_cloud:speech-to-text:4.2.1'
implementation 'com.ibm.watson.developer_cloud:android-sdk:0.4.3'
implementation 
'com.ibm.mobilefirstplatform.clientsdk.android:analytics:1.1.0'
testImplementation 'junit:junit:4.12'
implementation 'com.google.android.gms:play-services:10.0.1'
implementation 'com.android.support:multidex:1.0.1'

} }

Add this line in manifest tag at top of manifest file: 在清单文件顶部的清单标记中添加以下行:

xmlns:tools="http://schemas.android.com/tools"

& update your application tag like this: 并更新您的应用程序标签,如下所示:

<application
            android:allowBackup="true"
            android:icon="@mipmap/ic_face"
            android:label="@string/app_name"
            android:supportsRtl="true"
            android:theme="@style/AppTheme"
            tools:replace="android:value">

I would suggest to cleanup your support library dependency to have same release version. 我建议清理您的支持库依赖项以具有相同的发行版本。

implementation "com.android.support:design:26.1.0"
implementation "com.android.support:appcompat-v7:26.1.0"

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 任务“:app:processDebugManifest”执行失败:重复<meta-data /> AndroidManifest.xml 中的元素 - Execution failed for task ':app:processDebugManifest': Dupicate <meta-data/> element in AndroidManifest.xml Flutter 错误:任务“:app:generateDebugBuildConfig”执行失败。 (/android/app/src/main/AndroidManifest.xml 中的问题) - Flutter error : Execution failed for task ':app:generateDebugBuildConfig'. (problem in /android/app/src/main/AndroidManifest.xml ) Androidmanifest.xml文件中的gradle构建错误 - gradle build error in Androidmanifest.xml file 错误:任务&#39;:app:processDebugManifest&#39;的执行失败 - Error:Execution failed for task ':app:processDebugManifest' 错误:任务&#39;:app:processDebugManifest&#39;的执行失败。 &gt; - Error:Execution failed for task ':app:processDebugManifest'. > 错误:任务&#39;:app:processDebugManifest&#39;的执行失败。 - Error:Execution failed for task ':app:processDebugManifest'.? Gradle 中的任务“:app:processDebugManifest”执行失败 - Execution failed for task ':app:processDebugManifest' in Gradle 错误:任务&#39;:app:processDebugManifest&#39;的执行失败。 &gt;清单合并失败 - Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger failed Android Studio:错误:任务&#39;:app:processDebugManifest&#39;的执行失败 - Android studio : Error:Execution failed for task ':app:processDebugManifest' 错误:任务“:app:processDebugManifest”执行失败。 怎么修? - Error:Execution failed for task ':app:processDebugManifest'. How to fix?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM