Manifest merger failed with multiple errors, see logs (Error:Execution failed for task ':app:processDebugManifest')
Manifest merger failed with multiple errors, see logs (Error:Execution failed for task ':app:processDebugManifest')
在我提问之前,我想声明我搜索了很多类似的话题,但其中 none 有效。
我正在调试我的应用程序,出于某种原因,当我清理并重建我的项目时,我得到了错误:Manifest merge failed with multiple errors,查看日志
在我的 gradle 控制台中,我检查并得到了这个:
C:\Users\Chris\AndroidStudioProjects\WizardCounter2\app\src\main\AndroidManifest.xml:6:5-44:16
错误:元素 activity 在 AndroidManifest.xml:6:5-44:16[=13= 缺少 'name' 键属性]
C:\Users\Chris\AndroidStudioProjects\WizardCounter2\app\src\main\AndroidManifest.xml
错误:
验证失败,正在退出
这是我的清单:
<?xml version="1.0" encoding="utf-8"?>
<activity
android:allowBackup="true"
android:icon="@drawable/counter_launch_icon"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme"
>
<activity
android:name=".HomeScreen"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".GameMenu"
android:label="@string/title_activity_game_menu"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"
android:value="HomeScreen"/>
<activity
android:name=".PlayerSelection"
android:label="@string/title_activity_player_selection"
android:value="PlayerSelection"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"
>
</activity>
<support-screens
android:smallScreens="true"
android:normalScreens="true" />
</activity>
和build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "com.gameapp.android.wizardcounter"
minSdkVersion 9
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.android.support:design:25.0.0'
}
P.S 我是 运行 版本 2.3 并如您所见更新了工具...!
提前谢谢大家!
而不是 activity 放置应用程序并将所有活动放入其中,如下所示:
<?xml version="1.0" encoding="utf-8"?>
<application
android:allowBackup="true"
android:icon="@drawable/counter_launch_icon"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme"
>
<activity
android:name=".HomeScreen"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".GameMenu"
android:label="@string/title_activity_game_menu"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"
android:value="HomeScreen"/>
<activity
android:name=".PlayerSelection"
android:label="@string/title_activity_player_selection"
android:value="PlayerSelection"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"
>
</activity>
<support-screens
android:smallScreens="true"
android:normalScreens="true" />
</application>
对我来说是因为我在清单中声明了同一个元标记两次,看看你是否声明了两次。
在我提问之前,我想声明我搜索了很多类似的话题,但其中 none 有效。
我正在调试我的应用程序,出于某种原因,当我清理并重建我的项目时,我得到了错误:Manifest merge failed with multiple errors,查看日志
在我的 gradle 控制台中,我检查并得到了这个:
C:\Users\Chris\AndroidStudioProjects\WizardCounter2\app\src\main\AndroidManifest.xml:6:5-44:16
错误:元素 activity 在 AndroidManifest.xml:6:5-44:16[=13= 缺少 'name' 键属性]
C:\Users\Chris\AndroidStudioProjects\WizardCounter2\app\src\main\AndroidManifest.xml
错误: 验证失败,正在退出
这是我的清单:
<?xml version="1.0" encoding="utf-8"?>
<activity
android:allowBackup="true"
android:icon="@drawable/counter_launch_icon"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme"
>
<activity
android:name=".HomeScreen"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".GameMenu"
android:label="@string/title_activity_game_menu"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"
android:value="HomeScreen"/>
<activity
android:name=".PlayerSelection"
android:label="@string/title_activity_player_selection"
android:value="PlayerSelection"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"
>
</activity>
<support-screens
android:smallScreens="true"
android:normalScreens="true" />
</activity>
和build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "com.gameapp.android.wizardcounter"
minSdkVersion 9
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.android.support:design:25.0.0'
}
P.S 我是 运行 版本 2.3 并如您所见更新了工具...! 提前谢谢大家!
而不是 activity 放置应用程序并将所有活动放入其中,如下所示:
<?xml version="1.0" encoding="utf-8"?>
<application
android:allowBackup="true"
android:icon="@drawable/counter_launch_icon"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme"
>
<activity
android:name=".HomeScreen"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".GameMenu"
android:label="@string/title_activity_game_menu"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"
android:value="HomeScreen"/>
<activity
android:name=".PlayerSelection"
android:label="@string/title_activity_player_selection"
android:value="PlayerSelection"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"
>
</activity>
<support-screens
android:smallScreens="true"
android:normalScreens="true" />
</application>
对我来说是因为我在清单中声明了同一个元标记两次,看看你是否声明了两次。