Unity Android manifest merge error

自古美人都是妖i 提交于 2019-12-12 02:16:47

问题


I'm trying to build my app for Android, but I keep getting these error messages which are on the picture. Since I'm beginner in programming, I have no idea what is wrong. Two manifest files are following: 1)

    <?xml version="1.0" encoding="utf-8"?>
<!--
This Google Mobile Ads plugin library manifest will get merged with your
application's manifest, adding the necessary activity and permissions
required for displaying ads.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.google.unity"
    android:versionName="1.0"
    android:versionCode="1">
  <uses-sdk android:minSdkVersion="9"
      android:targetSdkVersion="19" />
  <!-- Google Mobile Ads Permissions -->
  <uses-permission android:name="android.permission.INTERNET"/>
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
  <!-- Uncomment to add billing for in-app purchase ads -->
  <!--<uses-permission android:name="com.android.vending.BILLING"/> -->
  <application>
    <!-- Denote the referenced Google Play services version -->
    <meta-data android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />
    <!-- Google Mobile Ads Activity -->
    <activity android:name="com.google.android.gms.ads.AdActivity"
        android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
        android:theme="@android:style/Theme.Translucent" />
    <!-- InAppPurchase Activity -->
    <activity android:name="com.google.android.gms.ads.purchase.InAppPurchaseActivity"
        android:theme="@style/Theme.IAPTheme"/>
  </application>
</manifest>

2)

    <?xml version="1.0" encoding="utf-8"?>
<!--
This Google Mobile Ads plugin library manifest will get merged with your
application's manifest, adding the necessary activity and permissions
required for displaying ads.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.admob.demo"
    android:versionName="1.0"
    android:versionCode="1">
  <uses-sdk android:minSdkVersion="9"
      android:targetSdkVersion="19" />
  <!-- Google Mobile Ads Permissions -->
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
  <uses-permission android:name="android.permission.READ_PHONE_STATE" />
  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
  <uses-permission android:name="android.permission.ACCESS_COARSE_UPDATES" />
  <!-- Uncomment to add billing for in-app purchase ads -->
  <!--<uses-permission android:name="com.android.vending.BILLING"/> -->
  <application>
   <activity
            android:name="com.unity3d.player.UnityPlayerActivity"
            android:label="activetitle" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    <!-- Denote the referenced Google Play services version -->
    <meta-data android:name="com.google.android.gms.version"
        android:value="8115000" />
    <!-- Google Mobile Ads Activity -->
    <activity
             android:name="com.google.android.gms.ads.AdActivity"
             android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
             android:theme="@android:style/Theme.Translucent" />
  </application>
</manifest>

What I tried, was to change minimum API level from build settings, but it didn't help. I will also add screen from build settings, if you know how to fix it, then I would be really grateful!

build settings are these errors are these


回答1:


You have repeated lines in the manifest that can cause the manifest merge to fail as it doesn't know which one to keep. If the error persists, please copy the full error message in your post.

Remove this from your manifest 2:

 <meta-data android:name="com.google.android.gms.version"
        android:value="8115000" />
    <!-- Google Mobile Ads Activity -->
    <activity
             android:name="com.google.android.gms.ads.AdActivity"
             android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
             android:theme="@android:style/Theme.Translucent" />

EDIT:

To fix the problem with this plugin https://github.com/googleads/googleads-mobile-unity

The easiest way is to go to Assets -> Play Services Resolver -> Android Resolver -> Resolve client jars

That should update all your libraries and dependencies of your project, please make sure you have latest version of the plugin which is 3.2.0 as of today.



来源:https://stackoverflow.com/questions/42386122/unity-android-manifest-merge-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!