Android Studio:错误:任务':app:processDebugManifest'执行失败。 >清单合并失败,出现多个错误,请参阅日志

时间:2016-12-20 21:31:16

标签: android android-activity android-manifest

我是Android Studio的新手,我还有另外一个问题 我冒了最后的声誉点。

所以我按照本网站的步骤进行操作:https://developer.android.com/training/basics/supporting-devices/platforms.html 更确切地说,在该部分:使用平台样式和主题

我不理解我的错误,为什么它会给我一个错误 此外,这个错误意味着什么?

所以这是我的AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.bog.beg">

    <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="15" />
<!-- SET THE VERSIONS -->

    <application


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

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

        <!-- ACTIVITY SETS -->
        <activity android:theme="@android:style/Theme.Translucent" />


    </application>



</manifest>

如果我添加<activity android:theme="@android:style/Theme.Translucent" />,  它给了我这个错误

`Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed with multiple errors, see logs`

我看到了我的日志。我不确定是不是这样:

    -- Merging decision tree log ---
manifest
ADDED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml:2:1-33:12
    package
        ADDED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml:3:5-34
        INJECTED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml
        INJECTED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml
    android:versionName
        INJECTED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml
        INJECTED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml
    xmlns:android
        ADDED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml:2:11-69
    android:versionCode
        INJECTED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml
        INJECTED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml
uses-sdk
ADDED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml:5:5-73
MERGED from [com.android.support:appcompat-v7:25.1.0] C:\Users\bog\AndroidStudioProjects\Beg\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\25.1.0\AndroidManifest.xml:21:5-23:78
MERGED from [com.android.support:support-v4:25.1.0] C:\Users\bog\AndroidStudioProjects\Beg\app\build\intermediates\exploded-aar\com.android.support\support-v4\25.1.0\AndroidManifest.xml:21:5-23:54
MERGED from [com.android.support:support-fragment:25.1.0] C:\Users\bog\AndroidStudioProjects\Beg\app\build\intermediates\exploded-aar\com.android.support\support-fragment\25.1.0\AndroidManifest.xml:21:5-23:60
MERGED from [com.android.support:support-media-compat:25.1.0] C:\Users\bog\AndroidStudioProjects\Beg\app\build\intermediates\exploded-aar\com.android.support\support-media-compat\25.1.0\AndroidManifest.xml:21:5-23:63
MERGED from [com.android.support:support-core-ui:25.1.0] C:\Users\bog\AndroidStudioProjects\Beg\app\build\intermediates\exploded-aar\com.android.support\support-core-ui\25.1.0\AndroidManifest.xml:21:5-23:58
MERGED from [com.android.support:support-core-utils:25.1.0] C:\Users\bog\AndroidStudioProjects\Beg\app\build\intermediates\exploded-aar\com.android.support\support-core-utils\25.1.0\AndroidManifest.xml:21:5-23:61
MERGED from [com.android.support:animated-vector-drawable:25.1.0] C:\Users\bog\AndroidStudioProjects\Beg\app\build\intermediates\exploded-aar\com.android.support\animated-vector-drawable\25.1.0\AndroidManifest.xml:20:5-44
MERGED from [com.android.support:support-vector-drawable:25.1.0] C:\Users\bog\AndroidStudioProjects\Beg\app\build\intermediates\exploded-aar\com.android.support\support-vector-drawable\25.1.0\AndroidManifest.xml:21:5-43
MERGED from [com.android.support:support-compat:25.1.0] C:\Users\bog\AndroidStudioProjects\Beg\app\build\intermediates\exploded-aar\com.android.support\support-compat\25.1.0\AndroidManifest.xml:21:5-23:58
    tools:overrideLibrary
        ADDED from [com.android.support:appcompat-v7:25.1.0] C:\Users\bog\AndroidStudioProjects\Beg\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\25.1.0\AndroidManifest.xml:23:9-75
    android:targetSdkVersion
        ADDED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml:5:41-70
        INJECTED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml
        INJECTED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml
    android:minSdkVersion
        ADDED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml:5:15-40
        INJECTED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml
        INJECTED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml
application
ADDED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml:8:5-29:19
MERGED from [com.android.support:appcompat-v7:25.1.0] C:\Users\bog\AndroidStudioProjects\Beg\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\25.1.0\AndroidManifest.xml:25:5-20
MERGED from [com.android.support:support-v4:25.1.0] C:\Users\bog\AndroidStudioProjects\Beg\app\build\intermediates\exploded-aar\com.android.support\support-v4\25.1.0\AndroidManifest.xml:25:5-20
MERGED from [com.android.support:support-fragment:25.1.0] C:\Users\bog\AndroidStudioProjects\Beg\app\build\intermediates\exploded-aar\com.android.support\support-fragment\25.1.0\AndroidManifest.xml:25:5-20
MERGED from [com.android.support:support-media-compat:25.1.0] C:\Users\bog\AndroidStudioProjects\Beg\app\build\intermediates\exploded-aar\com.android.support\support-media-compat\25.1.0\AndroidManifest.xml:25:5-20
MERGED from [com.android.support:support-core-ui:25.1.0] C:\Users\bog\AndroidStudioProjects\Beg\app\build\intermediates\exploded-aar\com.android.support\support-core-ui\25.1.0\AndroidManifest.xml:25:5-20
MERGED from [com.android.support:support-core-utils:25.1.0] C:\Users\bog\AndroidStudioProjects\Beg\app\build\intermediates\exploded-aar\com.android.support\support-core-utils\25.1.0\AndroidManifest.xml:25:5-20
MERGED from [com.android.support:animated-vector-drawable:25.1.0] C:\Users\bog\AndroidStudioProjects\Beg\app\build\intermediates\exploded-aar\com.android.support\animated-vector-drawable\25.1.0\AndroidManifest.xml:22:5-20
MERGED from [com.android.support:support-vector-drawable:25.1.0] C:\Users\bog\AndroidStudioProjects\Beg\app\build\intermediates\exploded-aar\com.android.support\support-vector-drawable\25.1.0\AndroidManifest.xml:23:5-20
MERGED from [com.android.support:support-compat:25.1.0] C:\Users\bog\AndroidStudioProjects\Beg\app\build\intermediates\exploded-aar\com.android.support\support-compat\25.1.0\AndroidManifest.xml:25:5-20
    android:label
        ADDED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml:13:9-41
    android:supportsRtl
        ADDED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml:14:9-35
    android:allowBackup
        ADDED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml:11:9-35
    android:icon
        ADDED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml:12:9-43
    android:theme
        ADDED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml:15:9-40
activity#com.example.bog.beg.MainActivity
ADDED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml:16:9-22:20
    android:name
        ADDED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml:16:19-47
intent-filter#android.intent.action.MAIN+android.intent.category.LAUNCHER
ADDED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml:17:13-21:29
action#android.intent.action.MAIN
ADDED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml:18:17-69
    android:name
        ADDED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml:18:25-66
category#android.intent.category.LAUNCHER
ADDED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml:20:17-77
    android:name
        ADDED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml:20:27-74
activity#com.example.bog.beg.DisplayMessageActivity
ADDED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml:23:9-69
    android:name
        ADDED from C:\Users\bog\AndroidStudioProjects\Beg\app\src\main\AndroidManifest.xml:23:19-57

如果删除<activity android:theme="@android:style/Theme.Translucent" />, 没有错误显示,但为什么会这样?

我不知道风格是需要由我自己创建还是默认情况下给出(这对我来说更有意义)。

1 个答案:

答案 0 :(得分:0)

  

这个错误意味着什么。

:app:processDebugManifest'。 &GT; Manifest merger failed

很简单,AndroidManifest.xml文件中存在错误。

来自文档......

  

必须指定名称。

Android - <activity>

我在

中看不到android:name
<activity android:theme="@android:style/Theme.Translucent" />

基本上,我认为您提供的链接试图显示的所有内容都是您可以指定存在android:theme属性,该属性可以应用于<activity><application>

例如,

<activity 
    android:name=".DisplayMessageActivity"
    android:theme="@android:style/Theme.Translucent" />

或者你已经拥有的东西

<application
    ...
    android:theme="@style/AppTheme">