2017-03-05 55 views
3

在我问我想说明我搜索了很多类似的线程,但都没有工作。清单合并失败,出现多个错误,请参阅日志(错误:执行失败的任务':app:processDebugManifest')

我调试我的应用程序,由于某种原因,当我清理和rebuilded项目中,我得到了错误清单合并失败,多错误,请参阅日志

在我的我检查gradle这个控制台,并得到了此:

C:\用户\克里斯\ AndroidStudioProjects \ WizardCounter2 \应用\ SRC \主\的AndroidManifest.xml:6:5-44:16

错误:缺少 '姓名' 键上元件活动属性在Android上的manifest.xml:6:5-44:16

C:\用户\克里斯\ AndroidStudioProjects \ WizardCounter2 \应用\ SRC \主\的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' 

}

PS我运行2.3版本和更新的工具,你看... ! 谢谢大家!

+1

您不能在活动中嵌套活动,并且您的第一个活动缺少'android:name'属性。 – Titus

+0

好吧,以某种方式,你是对的,但与以前的版本,它的工作......不知道为什么......反正罗伯特的解决方案工作! –

+0

打开应用程序清单(AndroidManifest.xml),单击清单文件的“文本”选项卡旁边的“合并清单”选项卡。您可以在右栏中查看错误,尝试解决错误并重新构建它将解决此错误。 对于错误:https://readyandroid.wordpress.com/errorexecution-failed-for-task-appprocessdebugmanifest-manifest-merger-failed-with-multiple-errors-see-logs-android/ 有关更多检查:https:/ /readyandroid.wordpress.com/ –

回答

1

相反的活动提出申请,并把所有的活动里面是这样的:

<?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> 
+0

非常感谢罗伯特!有效!!! –

4

对我来说,它是因为我曾宣布在清单中相同的元标签两次,看看如果u已宣布的东西的两倍。

+0

但删除后它会自动添加,当我们再次建立。 我无法修改清单文件。 – shahnilay86

+0

@Shrini Jaiswal +1投给你。你节省了我的时间。谢谢。 –

相关问题