Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[DEPRECATED] Google Admob plugin for Unity ad is not clickable

Discussion in 'Android' started by DMTSource, Aug 10, 2013.

  1. DMTSource

    DMTSource

    Joined:
    Jul 11, 2013
    Posts:
    36
    This thread is referring to a deprecated version of the Admob SDK which will prevent you from publishing to Google Play starting August 1, 2014. Please upgrade to a third party plugin of your choice, like this one or the free Google one, which uses the Google Play Services SDK which now incorporates the new Admob SDK.

    Note seen on AdmobDashboard prior to deprecation:
    Have you upgraded your SDK?
    On Aug. 1 2014, Google Play will stop accepting new or updated apps using the standalone Google Mobile Ads SDKs v6.4.1 or lower. Upgrade to the Google Play version of the Mobile Ads SDK to take advantage of new features, including automatic updates such as bug fixes.

    -----------------------------------

    Are you using Admob to monetize your Unity powered Android app and having click ability issues? There is a common problem with the setup of the Android manifest which prevents the adview to be unclickable. If your google admob plugin for unity is not clicking or clickable, then follow this quick fix to fix your manifest.

    Note:
    There are two sides to this problem sometimes, pre Unity 4.3 users may have fixed this already by adding the ForwardNativeEventsToDalvik to the manifest. However, post 4.3, it is now important which of the activities you add this command for it to work.

     
    Last edited: Aug 8, 2014
    ritesh_khokhani likes this.
  2. jvil

    jvil

    Joined:
    Jul 13, 2012
    Posts:
    263
    Add or modify this tag on Android Manifest:

    Code (csharp):
    1. <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
     
  3. DMTSource

    DMTSource

    Joined:
    Jul 11, 2013
    Posts:
    36
    Thank you that did the trick. I was not familiar with this tag and it was set to FALSE by default. Really really appreciate it!
     
  4. metiscoda

    metiscoda

    Joined:
    Nov 18, 2013
    Posts:
    41
    This seems to be broken again in 4.3.0 - the native events dont seem to be forwarded to Dalvik even if the above tag is set to true. It was working in 4.2.x.
     
  5. DMTSource

    DMTSource

    Joined:
    Jul 11, 2013
    Posts:
    36
    HERE IS THE FIX
    I just had this problem again after the 4.3 update and fixed it. I had to edit the manifest and change which Activity the ForwardNativeEventsToDalvik was called from due to a change in Unity 4.3.

    Move the line:
    <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />

    To the activity UnityPlayerProxyActivity. Aka right before the line with </Activity> like this:

    Code (csharp):
    1. <activity android:name="com.unity3d.player.UnityPlayerProxyActivity" android:launchMode="singleTask" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="landscape">
    2.       <intent-filter>
    3.         <action android:name="android.intent.action.MAIN" />
    4.         <category android:name="android.intent.category.LAUNCHER" />
    5.       </intent-filter>
    6.     <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
    7.     </activity>
    This fixed the problem for me right away. It seems in 4.3 they rearranged some of the players activities. Was a pain to loose a few days of ad rev.
     
    Last edited: Nov 19, 2013
    Mauro183 likes this.
  6. vARDAmir

    vARDAmir

    Joined:
    Jun 30, 2013
    Posts:
    38
    i lost 4 days... but this fix is really works. thank you =)
     
    Last edited: Nov 18, 2013
  7. Itstame

    Itstame

    Joined:
    Jul 30, 2012
    Posts:
    4
    Moving the ForwardNativeEventsToDalvik line to the UnityPlayerProxyActivity activity block fixed it for me, as well. However, I'm not using his package. It was a general issue with admob's manifest.
     
    Last edited: Nov 22, 2013
  8. alsharefeeee

    alsharefeeee

    Joined:
    Jul 6, 2013
    Posts:
    80
    thank you very much.
     
  9. kenlem

    kenlem

    Joined:
    Oct 16, 2008
    Posts:
    1,630
    Thanks DMTSource! I just ran into this it's working now with your fix.
     
  10. ABEMOS

    ABEMOS

    Joined:
    Sep 26, 2013
    Posts:
    5
    I have a quick question:
    I tried changing my AdMob unit ID and pit one that is made up (just added random numbers to see), and ads still showed in the game!!! is that normal?
    Thank you.
     
  11. DMTSource

    DMTSource

    Joined:
    Jul 11, 2013
    Posts:
    36
    ABEMOS, I would guess that the point of the AdMob unit ID may be tracking? So it could be showing ads for free and not tracking/associating them with any account. You could confirm something like this in the Admob dashboard, where no new impressions should be coming in(Reporting is not realtime and you will have to wait to see the results.).
     
  12. Mauro183

    Mauro183

    Joined:
    Dec 20, 2013
    Posts:
    2
    Thank you thank you thaank youuuu!!!
     
  13. ovidiubuligan

    ovidiubuligan

    Joined:
    Jun 5, 2013
    Posts:
    6
    Also tried this plugin ,works great , but when trying to hide the add(with AdMobPlugin.HideBannerView();)it doesn't do anything . Has anyone experienced this problem ?
     
  14. ovidiubuligan

    ovidiubuligan

    Joined:
    Jun 5, 2013
    Posts:
    6
    My mistake , it was a bug in my code ,it kept creating new AdViews every time the add should show
     
  15. MOSTY

    MOSTY

    Joined:
    Sep 6, 2013
    Posts:
    266
    Thank you for this thread. Very helpful!
     
  16. Xitech_

    Xitech_

    Joined:
    Feb 19, 2013
    Posts:
    140
    You're a life saver. Thanks dude :)
     
  17. xxandrejxx

    xxandrejxx

    Joined:
    Jan 4, 2014
    Posts:
    4
    thx a lot :)
     
  18. regy42

    regy42

    Joined:
    Feb 16, 2013
    Posts:
    8
    What version of Unity you used? This fix works for me in 4.3.1 (I am not sure about third number) and today I updated to 4.3.3. and it looks that ad is broken again. Thanks for your answers ang GL with Ad implementation!

    EDIT:
    I downgraded from 4.3.3. to 4.3.1 where this fix work!
    Its quite strange. I lost hundreds of dollars due to my last update :-(
     
    Last edited: Feb 10, 2014
  19. sunny8751

    sunny8751

    Joined:
    Jul 15, 2013
    Posts:
    3
    Hi, i did your fix but it isn't working for me and I can't click on the ads :(. I have

    <activity android:name="com.unity3d.player.UnityPlayerProxyActivity" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
    </activity>

    I am using unity 4.3.4f1.

    UPDATE: nvm. got it. I just had to change it back to what it was originally and it worked. Thanks.
     
    Last edited: Feb 15, 2014
  20. AhmadMujtaba

    AhmadMujtaba

    Joined:
    Jun 26, 2013
    Posts:
    1
    Thanks A lot. I wasted my whole day checking for the possible errors. That line you mentioned works for me. I added to the activity which I was using for my game ( I was using a plugin).
     
  21. mrKaizen

    mrKaizen

    Joined:
    Feb 14, 2011
    Posts:
    139
    Unity 4.3.4f1 > the fix works ;)

    TKS ^_^
     
  22. Hatredalper

    Hatredalper

    Joined:
    Nov 10, 2013
    Posts:
    2
    Hi guys. I am using Unity 4.3.4f1 and created a small game for and Android. Its on Google Play now but I cant add any adv.

    I import admob plugin but adv never show up. I would be gratefull if you can help me which plugin is working for admob for Unity 4.3.4f1.

    In my plugin there is no readme file but it has a .jar file GoogleAdMobAdsSdk-6.3.0.jar

    I dont know if this is latest or i am doing something wrong but banner never showing up.

    By the way -> (I copy my admob number to the inspector menu).
     
  23. Destroypattern

    Destroypattern

    Joined:
    Aug 21, 2013
    Posts:
    10
    Thanks for this. This fix worked for me.
    The line needs to be in the right place, contrary to instructional material.
     
  24. msakkuzu

    msakkuzu

    Joined:
    Dec 5, 2013
    Posts:
    7
    Saved my time, thank you. Unity 4.3.4f1
     
  25. Crichton333

    Crichton333

    Joined:
    May 4, 2014
    Posts:
    113
    Ok, I tried Unity from 4.3 to 4.5.1 and tried putting Dalvik under Proxy and also every other combinations possible in the Android.xml and Admob is still not clickable. Seriously whats up with this. Can someone post the entire Android.xml that actually works.
     
  26. BlackPanda

    BlackPanda

    Joined:
    Jan 24, 2014
    Posts:
    78
    Thanks DMTSource! This was a big help. I want to add a correction. The meta data should be added to the MAIN ACTIVITY in the manifest. It may not always be UnityPlayerNativeActivity or UnityPlayerProxyActivity.

    Cheers. :)
     
  27. Crichton333

    Crichton333

    Joined:
    May 4, 2014
    Posts:
    113
    There is no MAIN ACTIVITY in the Android manifest, there is a only MAIN action <action android:name="android.intent.action.MAIN" />
     
  28. BlackPanda

    BlackPanda

    Joined:
    Jan 24, 2014
    Posts:
    78
    Thanks. Happy you got the point.
     
  29. m-y

    m-y

    Joined:
    Sep 22, 2013
    Posts:
    471
    is there any tutorial how to add admob plugin into unity please ? !
     
  30. BlackPanda

    BlackPanda

    Joined:
    Jan 24, 2014
    Posts:
    78
  31. subrata

    subrata

    Joined:
    May 23, 2013
    Posts:
    2
    thnx..it worked
     
  32. DMTSource

    DMTSource

    Joined:
    Jul 11, 2013
    Posts:
    36
    Hey everyone, just wanted to update this old thread. The old Admob SDK(prior to 6.4) is being deprecated this August. That means that using this old Admob plugin which does NOT use the Google Play Services SDK which now includes the updated Admob SDK. This mean if you are using the old Admob SDK your apps will not be publishable on Google Play starting August 1, 2014.

    Admob/Google announced this a while backand I have been using the Google Mobile Ads SDK by Stan's Assets, but Google is also working on an official version. Regardless of your solution I suggest immediately publishing updates using the new SDK. This will improve your ad quality and appearance, give access to new special types of TrueView ads coming later this year.

    Official note from Admob, visible now in you Dashboard:
    Have you upgraded your SDK?
    On Aug. 1 2014, Google Play will stop accepting new or updated apps using the standalone Google Mobile Ads SDKs v6.4.1 or lower. Upgrade to the Google Play version of the Mobile Ads SDK to take advantage of new features, including automatic updates such as bug fixes.
     
    Last edited: Aug 8, 2014
  33. BlackLotos

    BlackLotos

    Joined:
    Aug 9, 2014
    Posts:
    10
    Hi, everyone. sorry for my english. As I understand, now admob plugin dont't work. Is it true? i can't understand - how to install Google Play Services in Unity and what need to do to make admob plugin work with it. So, can you tell me all steps to fix the problem with admob plugin?
     
  34. psyydack

    psyydack

    Joined:
    Aug 30, 2013
    Posts:
    93
    @BlackLotos here's a video:


    or if you want to try for yourself https://github.com/googleads/googleads-mobile-plugins
    It's an easy implementation. =)

    For fix click, don't forget to update ForwardNativeEventsToDalvik to true.
    Working here. Unity 4.6.0b17 .

    Here my entire NativePlayer Activity in AndroidManifest.xml

    Code (CSharp):
    1. <activity android:name="com.unity3d.player.UnityPlayerNativeActivity" android:label="@string/app_name">
    2.       <intent-filter>
    3.         <action android:name="android.intent.action.MAIN" />
    4.         <category android:name="android.intent.category.LAUNCHER" />
    5.       </intent-filter>
    6.       <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
    7.       <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
    8.     </activity>
     
  35. maria-dev

    maria-dev

    Joined:
    Sep 19, 2014
    Posts:
    10
    Ads are not showing but in admob dashboard its showing 12 ad request .
    help me
     
  36. nithu

    nithu

    Joined:
    Nov 21, 2012
    Posts:
    1
    place the below two meta-data

    Code (CSharp):
    1. <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
    2.       <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
    where the "Launcher" activity using.
     
  37. sush333

    sush333

    Joined:
    Jan 26, 2015
    Posts:
    32
    it's not working for me even if i set it to true;

    here-

    <activity android:label="@String/app_name" android:name="com.unity3d.player.UnityPlayerNativeActivity" android:screenOrientation="sensorLandscape" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LEANBACK_LAUNCHER" /> </intent-filter> <meta-data android:name="unityplayer.UnityActivity" android:value="true" /> <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" /> </activity>



    ADS are clicking but not opening.
     
  38. HelloFrance

    HelloFrance

    Joined:
    Jun 10, 2015
    Posts:
    2
    Help, I can't modify false in a true.

    I build my project and true became false !

    Can you help me please ?
     
  39. sush333

    sush333

    Joined:
    Jan 26, 2015
    Posts:
    32
    how is that possible france? it can not become false automatically after saving and building.
     
  40. HelloFrance

    HelloFrance

    Joined:
    Jun 10, 2015
    Posts:
    2
    I found the solution. I had changed the AndroidManifest here :

    C:\Program Files (x86)\Unity\Editor\Data\PlaybackEngines\androidplayer


    Thanks :)
     
    Last edited: Jun 13, 2015
    BMRG14 likes this.
  41. Vijay-Kumar-R

    Vijay-Kumar-R

    Joined:
    Jul 5, 2013
    Posts:
    2
    HelloFrance,

    I had the same problem, Temp/StagingArea/AndroidManifest.xml was getting overwritten with false.
    After updating the value to true in androidplayer\AndroiManifest.xml, its working.

    Thanks
     
  42. RigbySug

    RigbySug

    Joined:
    Oct 22, 2014
    Posts:
    4
    I changed my AndroidManifest.xml file but still problem is working how can i fix this problem i can't click Banner Ads


    Code (CSharp):
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <!--
    3. This Google Mobile Ads plugin library manifest will get merged with your
    4. application's manifest, adding the necessary activity and permissions
    5. required for displaying ads.
    6. -->
    7. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    8.    package="com.google.unity"
    9.    android:versionName="1.0"
    10.    android:versionCode="1">
    11.  <uses-sdk android:minSdkVersion="9"
    12.      android:targetSdkVersion="19" />
    13.  <!-- Google Mobile Ads Permissions -->
    14.  <uses-permission android:name="android.permission.INTERNET"/>
    15.  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    16.  <!-- Uncomment to add billing for in-app purchase ads -->
    17.  <uses-permission android:name="com.android.vending.BILLING"/>
    18.  <application>
    19.    <!-- Denote the referenced Google Play services version -->
    20.    <meta-data android:name="com.google.android.gms.version"
    21.        android:value="@integer/google_play_services_version" />
    22.    <!-- Google Mobile Ads Activity -->
    23.            <activity android:name="com.google.android.gms.ads.AdActivity"
    24.        android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
    25.    <!-- InAppPurchase Activity -->
    26.    <activity android:name="com.google.android.gms.ads.purchase.InAppPurchaseActivity"
    27.        android:theme="@style/Theme.IAPTheme"/>
    28.        <!-- Click Activity -->
    29.    <activity android:name="com.unity3d.player.UnityPlayerProxyActivity" android:launchMode="singleTask" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="landscape">
    30.      <intent-filter>
    31.        <action android:name="android.intent.action.MAIN" />
    32.        <category android:name="android.intent.category.LAUNCHER" />
    33.      </intent-filter>
    34.    <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
    35.    </activity>
    36. </application>
    37. </manifest>
    38.  
     
  43. bigjobs

    bigjobs

    Joined:
    Feb 24, 2016
    Posts:
    14
    try https://github.com/unity-plugins/Unity-Admob ,all is automatic ,not need change main activity
     
  44. herbou

    herbou

    Joined:
    Jul 8, 2018
    Posts:
    2
    Here is a video tutorial shows the right way to implement Native Ads Admob in unity .100% working

     
  45. m1t3sh

    m1t3sh

    Joined:
    Dec 25, 2017
    Posts:
    4
    I have the Same Problem my native ad is shown but the ad click is not working plz help