2017-03-05 63 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投給你。你節省了我的時間。謝謝。 –

相關問題