2016-12-20 48 views
0

我是新来的Android Studio和我有一个问题。
我冒着我的最后一个点声望值BTW。Android Studio:错误:执行任务':app:processDebugManifest'失败。 >清单合并失败,多错误,请参阅日志

所以我下面从本网站的步骤: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" />, 没有错误的表现,但为什么会出现这种情况?

我不知道如果样式需要由自己创造,如果它在默认情况下给出的(这使我更有意义)。

回答

0

what does this error mean.

:app:processDebugManifest'。 >Manifest merger failed

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


从文档...

The name must be specified.

Android - <activity>

我没有看到一个android:name

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

基本上,我认为所有的链接您提供试图表明是可以指定有存在既可以应用于<activity><application>android:theme属性。

例如,

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

或者你已经拥有

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

只是为了确保我明白了。 – Bog

+0

对不起,按回车太快。反正:::的<活动安卓主题=“@安卓风格/ Theme.Translucent” />不是必须的,但如果我想拥有它,我需要一个名字。我现在设置了一个android:name =“stuff”,这意味着我需要在我的应用程序的某个地方使用这个活动(如果我没有错的话)。如果我再次正确,我需要以风格使用它。这是吗? – Bog

+0

忘记它吧。正如你所提到的,我已经有了一个android:theme ...我只是设置了“@android:style.Thee.Translucent”。这是否会以不好的方式影响我的项目? – Bog

相关问题