Unity Android清单合并错误 [英] Unity Android manifest merge error

查看:165
本文介绍了Unity Android清单合并错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为Android构建我的应用程序,但我不断收到图片上的这些错误消息.由于我是编程的新手,所以我不知道哪里出了问题.以下是两个清单文件:1)

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>

我尝试的是从构建设置更改最低API级别,但这没有帮助.我还将在构建设置中添加屏幕,如果您知道如何修复它,那么我将非常感激!

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!

构建设置就是这些 这些错误

推荐答案

清单中有重复的行,这可能导致清单合并失败,因为它不知道要保留哪一个.如果错误仍然存​​在,请在您的帖子中复制完整的错误消息.

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.

从清单2中删除此内容:

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" />

要解决此插件的问题,请 https://github.com/googleads/googleads-移动联盟

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

最简单的方法是转到资产-> Play服务解析器-> Android解析器->解析客户端jars

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

这应该更新您所有的库和项目的依赖项,请确保您拥有的插件的最新版本为3.2.0.

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.

这篇关于Unity Android清单合并错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆