- Home /
issue when building player apk after adding google admob
Hi I really need help on this one, the error when building game:
Error: [Temp\StagingArea\AndroidManifest-main.xml:12, C:\Users\Marco\Documents\Unity Projects\Smash Run\Temp\StagingArea\android-libraries\GoogleMobileAdsPlugin\AndroidManifest.xml:10] Trying to merge incompatible /manifest/application/activity[@name=com.google.android.gms.ads.AdActivity] element:
UnityEditor.HostView:OnGUI()
AND:
Error building Player: CommandInvokationFailure: Unable to merge android manifests. See the Console for more details. C:\NVPACK\jdk1.6.0_24\bin\java.exe -Xmx1024M -Dcom.android.sdkmanager.toolsdir="C:/NVPACK/android-sdk-windows\tools" -Dfile.encoding=UTF8 -jar "C:/Program Files (x86)/UnityBeta/Editor/Data/BuildTargetTools/AndroidPlayer\sdktools.jar" -
stderr[ Error: [Temp\StagingArea\AndroidManifest-main.xml:12, C:\Users\Marco\Documents\Unity Projects\Smash Run\Temp\StagingArea\android-libraries\GoogleMobileAdsPlugin\AndroidManifest.xml:10] Trying to merge incompatible /manifest/application/activity[@name=com.google.android.gms.ads.AdActivity] element:
++ ++(end reached) ] stdout[ [Temp\StagingArea\AndroidManifest-main.xml:13, C:\Users\Marco\Documents\Unity Projects\Smash Run\Temp\StagingArea\android-libraries\GoogleMobileAdsPlugin\AndroidManifest.xml:8] Skipping identical /manifest/application/meta-data[@name=com.google.android.gms.version] element. [Temp\StagingArea\AndroidManifest-main.xml:13, C:\Users\Marco\Documents\Unity Projects\Smash Run\Temp\StagingArea\android-libraries\MainLibProj\AndroidManifest.xml:8] Skipping identical /manifest/application/meta-data[@name=com.google.android.gms.version] element. ]
I'm really lost and don't know what's going on?
When I locate the androidmanifest.xml file under
C:\Users\Marco\Documents\Unity Projects\Smash Run\Assets\Plugins\Android\GoogleMobileAdsPlugin
and rename it, then it builds fine, but no banner ads display in game.
If someone can explain to me what the error means to start off with and a possible solution would be a bonus.
This is my bread and butter here..........
Hi moderators, please approve this or let me know if I haven't met the guidelines?
There are fewer moderators active in the last couple of months, and the ones active are taking more care before approving questions. It is not uncommon to wait several hours, and if posting at a quite time of day, I've seen wait times of up to 5 or 6 hours. The best solution in the short term is to become active on the list. When you have 15 karma points (which is a couple of thumbs up on comments or one accepted answer), your questions will no longer go through moderation.
Thank you Robert, apologies for being hasty. I will keep that in $$anonymous$$d, and try to answer others questions to improve my karma.
seems like a good system, however for newbies it gets a little difficult.
once again, thank you for approving. I'm hoping someone can help me soon.
Okay so I resolved this by removing the older plugin directory, as I added an older version of admob unity plugin first when watching an older tutorial.
However the ads still don't show in my game? my script below uses the Admob component script which has been assigned in the inspector. no errors now but still won't show ads on the main menu scene where this script is attached to an empty gameobject.
any ideas?
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
[RequireComponent(typeof(Ad$$anonymous$$obPlugin))]
public class ShowAds : $$anonymous$$onoBehaviour
{
private const string AD_UNIT_ID = "ca-app-pub-4633443251598509/3727397274";
private Ad$$anonymous$$obPlugin admob;
//public bool hidden = true;
void Awake()
{
//DontDestroyOnLoad(this);
}
// Use this for initialization
void Start ()
{
admob = GetComponent<Ad$$anonymous$$obPlugin>();
admob.CreateBanner(adUnitId: AD_UNIT_ID,
adSize: Ad$$anonymous$$obPlugin.AdSize.S$$anonymous$$ART_BANNER,
isTopPosition: true);
admob.RequestAd();
ShowTheAds();
}
// Update is called once per frame
void ShowTheAds()
{
admob.ShowBanner();
//admob.HideBanner();
}
}
Answer by Naamani · Aug 07, 2015 at 04:09 PM
For me, removing these lines:
<activity android:name="com.google.android.gms.ads.AdActivity"
android:label="@string/app_name"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
</activity>
From the "Plugins/Android/AndroidManifest.xml" file did the trick.
Answer by shelo941 · Apr 18, 2015 at 08:45 PM
Had same Error tried almost everything.When i got desperate,i deleted android manifest (Plugins/Android/AndroidManifest) . and problem was solved, than i copied manifest from temp (AndroidManifest,not AndroidManifest-main) and changed some values there wich i needed for other things.
Your answer
Follow this Question
Related Questions
Google Mobile Ads Interstitial ads is not showing in unity 2 Answers
GoogleMobileAds: As soon as I add my real banner ID, it stops working. 0 Answers
Andriod GoogleMobileAds not working in Real Device(Http respose code:400), 0 Answers
Unity Admob glitching game screen 1 Answer
App stops working as soon it starts. 0 Answers