2017-02-22 60 views
0

我試圖建立我的應用程序爲Android,但我不斷收到這是在圖片上這些錯誤消息。由於我是編程初學者,我不知道什麼是錯的。兩個清單文件如下:1)統一Android清單合併錯誤

<?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級別,但它並沒有幫助。我還將從構建設置中添加屏幕,如果您知道如何修復它,那麼我會非常感激!

build settings are these errors are these

回答

0

你反覆在清單線,可能會導致清單合併失敗,因爲它不知道讓哪個。如果錯誤仍然存​​在,請在文章中複製完整的錯誤消息。

從清單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-mobile-unity

最簡單的方法就是去資產解決問題 - >播放服務解析器 - > Android的解析器 - >解決客戶罐子

這應該更新項目的所有庫和依賴,請小號你有今天的3.2.0的最新版本的插件。

+0

非常感謝你,這所做的工作!但現在我得到另一個..它看起來是這樣的: CommandInvokationFailure:無法對類轉換成DEX格式。 /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir = 「/用戶/管理員/庫/安卓/ SDK /工具」 -Dfile。編碼= UTF8罐子「/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar」 任何想法,做這個嗎? – Kevin

+0

這個錯誤沒有用,請你把所有的錯誤都完全複製過來? –

+0

既然這麼長,我會複製它作爲新的答案:) – Kevin