当前位置: 首页 > 知识库问答 >
问题:

错误:任务“:app:ProcessDebugManifest”执行失败。如何修复?

方心思
2023-03-14

我在Android Studio上出错了。错误:任务“:app:ProcessDebugManifest”html" target="_blank">执行失败。

清单合并失败:来自AndroidManifest.xml:28:9-52的属性Application@Theme Value=(@style/AppTheme.NOActionBar)也存在于[:AdGateMediaSDK:]AndroidManifest.xml:19:9-40 Value=(@style/AppTheme).建议:将'tools:replace=“android:theme”‘添加到androidmanifest.xml:22:5-195:19的元素中,以重写。

这是我的AndroidManifest.xml文件

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

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="com.makeuprewardz.app.permission.C2D_MESSAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.gms.permission.ACTIVITY_RECOGNITION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.REAL_GET_TASKS" />


<application
    android:name="com.makeuprewardz.app.App"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme.NoActionBar">


    <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>

    <activity android:name="com.makeuprewardz.app.ui.activity.MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

    <activity
        android:name="com.makeuprewardz.app.ui.activity.HomeActivity"
        android:launchMode="singleTask"/>

    <activity
        android:name="com.makeuprewardz.app.ui.activity.RegisterActivity"
        android:launchMode="singleTask"/>

    <activity
        android:name=".ui.activity.LoginActivity"
        android:launchMode="singleTask"/>

    <activity
        android:name="com.makeuprewardz.app.ui.activity.StartActivity"
        android:launchMode="singleTask"/>

    <meta-data android:name="com.appodeal.framework" android:value="android" />
    <receiver android:name="com.appodeal.ads.AppodealPackageAddedReceiver" android:exported="true" android:enabled="true">
    <intent-filter>
        <action android:name="android.intent.action.PACKAGE_ADDED" />
        <data android:scheme="package" />
    </intent-filter>
    </receiver>

    <activity android:name="com.appodeal.ads.InterstitialActivity"
        android:configChanges="orientation|screenSize"
        android:theme="@android:style/Theme.Translucent.NoTitleBar" />
    <activity android:name="com.appodeal.ads.VideoActivity"
        android:configChanges="orientation|screenSize"
        android:theme="@android:style/Theme.Translucent.NoTitleBar" />

    <activity android:name="com.appodeal.ads.LoaderActivity"
        android:configChanges="orientation|screenSize"
        android:theme="@android:style/Theme.Translucent.NoTitleBar" />

    <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />

    <activity android:name="com.google.android.gms.ads.AdActivity"
        android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
        android:theme="@android:style/Theme.Translucent" />

    <activity android:name="com.chartboost.sdk.CBImpressionActivity" android:excludeFromRecents="true"
        android:hardwareAccelerated="true" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"
        android:configChanges="keyboardHidden|orientation|screenSize" />

    <activity android:name="com.applovin.adview.AppLovinInterstitialActivity"
        android:theme="@android:style/Theme.Translucent" />

    <activity android:name="com.mopub.mobileads.MoPubActivity"
        android:configChanges="keyboardHidden|orientation|screenSize"
        android:theme="@android:style/Theme.Translucent" />
    <activity android:name="com.mopub.common.MoPubBrowser"
        android:configChanges="keyboardHidden|orientation|screenSize" />
    <activity android:name="com.mopub.mobileads.MraidActivity"
        android:configChanges="keyboardHidden|orientation|screenSize" />
    <activity android:name="com.mopub.mobileads.MraidVideoPlayerActivity"
        android:configChanges="keyboardHidden|orientation|screenSize" />

    <activity android:name="org.nexage.sourcekit.mraid.MRAIDBrowser"
        android:configChanges="orientation|keyboard|keyboardHidden|screenSize"
        android:theme="@android:style/Theme.Translucent" />


    <activity android:name="com.amazon.device.ads.AdActivity" android:configChanges="keyboardHidden|orientation|screenSize"/>

    <activity android:name="org.nexage.sourcekit.vast.activity.VASTActivity"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />

    <activity android:name="org.nexage.sourcekit.vast.activity.VPAIDActivity"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />

    <!--suppress AndroidDomInspection -->
    <activity android:name="com.appodeal.ads.networks.vpaid.VPAIDActivity"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />

    <activity android:name="com.appodeal.ads.networks.SpotXActivity"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen"/>
    <!--suppress AndroidDomInspection -->

    <activity android:name="com.unity3d.ads.adunit.AdUnitActivity"
        android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:hardwareAccelerated="true" />
    <activity android:name="com.unity3d.ads.adunit.AdUnitSoftwareActivity"
        android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:hardwareAccelerated="false" />
    <activity android:name="com.unity3d.ads2.adunit.AdUnitActivity"
        android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:hardwareAccelerated="true" />
    <activity android:name="com.unity3d.ads2.adunit.AdUnitSoftwareActivity"
        android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:hardwareAccelerated="false" />


    <!--suppress AndroidDomInspection -->
    <activity android:name="com.jirbo.adcolony.AdColonyOverlay"
        android:configChanges="keyboardHidden|orientation|screenSize"
        android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
    <!--suppress AndroidDomInspection -->
        <activity android:name="com.jirbo.adcolony.AdColonyFullscreen"
        android:configChanges="keyboardHidden|orientation|screenSize"
        android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" />
    <!--suppress AndroidDomInspection -->
    <activity android:name="com.jirbo.adcolony.AdColonyBrowser"
        android:configChanges="keyboardHidden|orientation|screenSize"
        android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" />
    <!--suppress AndroidDomInspection -->
    <activity android:name="com.vungle.publisher.FullScreenAdActivity"
        android:configChanges="keyboardHidden|orientation|screenSize"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen"/>
    <!--suppress AndroidDomInspection -->
    <activity android:name="com.startapp.android.publish.list3d.List3DActivity"
        android:theme="@android:style/Theme" />
    <!--suppress AndroidDomInspection -->
    <activity android:name="com.startapp.android.publish.OverlayActivity"
        android:theme="@android:style/Theme.Translucent"
        android:configChanges="orientation|keyboardHidden|screenSize" />
    <!--suppress AndroidDomInspection -->
    <activity android:name="com.startapp.android.publish.FullScreenActivity"
        android:theme="@android:style/Theme"
        android:configChanges="orientation|keyboardHidden|screenSize" />

    <!--suppress AndroidDomInspection -->
    <activity android:name="com.yandex.mobile.ads.AdActivity"
        android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />

    <!--suppress AndroidDomInspection -->
    <activity android:name="com.flurry.android.FlurryFullscreenTakeoverActivity"
        android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />

    <activity android:name="com.appodeal.ads.VideoPlayerActivity" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"/>

  <!--suppress AndroidDomInspection -->
    <activity android:name="com.revmob.FullscreenActivity" android:theme="@android:style/Theme.Translucent"
        android:configChanges="keyboardHidden|orientation"/>

    <!--suppress AndroidDomInspection -->
    <activity android:name="com.tapjoy.TJAdUnitActivity" android:configChanges="orientation|keyboardHidden|screenSize"
        android:hardwareAccelerated="true" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
    <!--suppress AndroidDomInspection -->
    <activity android:name="com.tapjoy.mraid.view.ActionHandler" android:configChanges="orientation|keyboardHidden|screenSize" />
    <!--suppress AndroidDomInspection -->
    <activity android:name="com.tapjoy.mraid.view.Browser" android:configChanges="orientation|keyboardHidden|screenSize" />
    <!--suppress AndroidDomInspection -->
    <activity android:name="com.tapjoy.TJContentActivity" android:configChanges="orientation|keyboardHidden|screenSize"
        android:theme="@android:style/Theme.Translucent.NoTitleBar" android:hardwareAccelerated="true" />

    <activity android:name="com.adscendmedia.sdk.ui.OffersActivity"
        android:configChanges="orientation|screenSize">
    </activity>

    <activity
        android:name="com.playerize.superrewards.activities.SRWebViewActivity"
        android:screenOrientation="portrait" />

</application>
<resources xmlns:tools="http://schemas.android.com/tools">

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>

<style name="AppTheme.Dark" parent="Theme.AppCompat.NoActionBar">
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>

    <item name="android:windowBackground">@color/colorPrimary</item>

    <item name="colorControlNormal">@color/iron</item>
    <item name="colorControlActivated">@color/white</item>
    <item name="colorControlHighlight">@color/white</item>
    <item name="android:textColorHint">@color/iron</item>

    <item name="colorButtonNormal">@color/colorPrimaryDark</item>
    <item name="android:colorButtonNormal" tools:targetApi="lollipop">@color/colorPrimaryDark</item>

</style>

<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/>

<style name="AppTheme.NoActionBar">
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
    <!--<item name="drawerArrowStyle">@style/MaterialDrawer.DrawerArrowStyle</item>-->
    <!-- <item name="preferenceTheme">@style/PreferenceThemeOverlay</item>-->
</style>

<style name="AppTheme.NoActionBar.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/>

<style name="Toolbar_TextAppearance_White">
    <item name="android:textSize">18sp</item>
    <item name="android:textColor">@android:color/white</item>
</style>

<style name="SwitchButtonStyle">
    <item name="android:paddingLeft">10dp</item>
    <item name="android:paddingRight">10dp</item>
    <item name="android:paddingTop">4dp</item>
    <item name="android:paddingBottom">4dp</item>
</style>

共有1个答案

颛孙麻雀
2023-03-14

您在项目中使用了Adgate Media SDK。
我不知道您是如何将该SDK添加到项目中的,但Adgate SDK的清单正在与项目清单合并。
合并本身可能不是问题,但应用程序标记中的android:theme属性冲突才是问题所在。
要解决冲突,您应该将tools:replace=“android:theme”添加到应用程序标记中,这样manifest-merger就会知道冲突并防止冲突。
例如:

<application
    android:name="com.makeuprewardz.app.App"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme.NoActionBar"
    tools:replace="android:theme>

.
还有其他方法可以绕过清单合并冲突,但我建议使用上面的方法。
有关清单合并和解决其冲突的更多信息,在google developers:link上有一个很好的文档

 类似资料: