Banner Ads are not showing in android app in unity!!!

3,183 views
Skip to first unread message

abbas2...@gmail.com

unread,
Jul 22, 2016, 5:34:51 AM7/22/16
to Google Mobile Ads SDK Developers
I am building an app and I want to show banner ads in it so,I follow some tutorials on youtube and Integrate admob without any error in my app but after I build my app and test it on my mobile it shows no banner ads,I waited hours to see that ad but not a single banner ad shows up.

Unity 5.2.3
Google  Mobile Ads Unity plugin v3.0.5
My Android Manifest:
<?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.
-->
    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" />
<activity android:name="com.unity3d.player.UnityPlayerNativeActivity"
    android:label="@string/app_name">
    <intent-filter>
      <action android:name="android.intent.action.MAIN" />
      <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
    <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik"
        android:value="true" />
</activity>
  </application>
</manifest>


My Script which I added to my main camera:
using UnityEngine;
using System.Collections;
using GoogleMobileAds.Api;
public class admanager : MonoBehaviour {

// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}

private void RequestBanner()
{
#if UNITY_ANDROID
string adUnitId = "ca-app-pub-8615535514605399/4129615660";
#elif UNITY_IPHONE
string adUnitId = "INSERT_IOS_BANNER_AD_UNIT_ID_HERE";
#else
string adUnitId = "unexpected_platform";
#endif
// Create a 320x50 banner at the top of the screen.
BannerView bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Top);
// Create an empty ad request.
AdRequest request = new AdRequest.Builder().Build();
// Load the banner with the request.
bannerView.LoadAd(request);
}
}

please reply as soon as possible.

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Jul 22, 2016, 12:51:09 PM7/22/16
to Google Mobile Ads SDK Developers
Hi there,

Looking at your code, are you calling your RequestBanner() from anywhere? Just wanted to make sure that you are actually making the request. As a reference you can use our sample code and see if you are able to load ads with that. Also, once you have deployed the app on to your device, can you run Android Studio and send us the log? 

Thanks,
Veer Busani
Mobile Ads SDK Team

Abbas Rizvi

unread,
Jul 22, 2016, 1:45:59 PM7/22/16
to google-adm...@googlegroups.com
I don't know much about coding, I build my app using Playmaker.I copy this code from firebase.google.com attach it my camera but nothing shows up ,I request you to kindly use my ad id and use it build a sample app and tell me that it works or not.Because i don't know how to code.Hope you understand, sorry for my english.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/rywDPuG8u_I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Jul 22, 2016, 5:10:33 PM7/22/16
to Google Mobile Ads SDK Developers
Hi Abbas,

You need to call that function to request ads. You have simply created a function without any way to actually call it. For example, in your Start() method, call the RequestBanner() like this: 

// Use this for initialization
void Start () {

   RequestBanner()
}

Also, you can use this sample app to load ads. Note that you need to add your Ad Unit ID in the Assets > Scripts > GoogleMobileAdsDemoScript.cs file.

Thanks,
Veer Busani
Mobile Ads SDK Team

On Friday, July 22, 2016 at 1:45:59 PM UTC-4, Abbas Rizvi wrote:
I don't know much about coding, I build my app using Playmaker.I copy this code from firebase.google.com attach it my camera but nothing shows up ,I request you to kindly use my ad id and use it build a sample app and tell me that it works or not.Because i don't know how to code.Hope you understand, sorry for my english.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.

Abbas Rizvi

unread,
Jul 23, 2016, 4:40:02 AM7/23/16
to google-adm...@googlegroups.com
So, as you tell me I edit my script and it look like this:

using UnityEngine;
using System.Collections;
using GoogleMobileAds.Api;
public class admanager : MonoBehaviour {

// Use this for initialization
void Start () {
RequestBanner ();
}
// Update is called once per frame
void Update () {
}

private void RequestBanner()
{
#if UNITY_ANDROID
string adUnitId = "ca-app-pub-8615535514605399/4129615660";
#elif UNITY_IPHONE
string adUnitId = "INSERT_IOS_BANNER_AD_UNIT_ID_HERE";
#else
string adUnitId = "unexpected_platform";
#endif
// Create a 320x50 banner at the top of the screen.
BannerView bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Top);
// Create an empty ad request.
AdRequest request = new AdRequest.Builder().Build();
// Load the banner with the request.
bannerView.LoadAd(request);
}
}

and when i open my app in my mobile it says "Unfortunately rocket fly has stopped" ,rocket fly is name of my app.Please help!!

On Sat, Jul 23, 2016 at 2:10 AM, 'Veer Arjun Busani(Mobile Ads SDK Team)' via Google Mobile Ads SDK Developers <google-adm...@googlegroups.com> wrote:
Hi Abbas,

You need to call that function to request ads. You have simply created a function without any way to actually call it. For example, in your Start() method, call the RequestBanner() like this: 

// Use this for initialization
void Start () {
   RequestBanner()
}

Also, you can use this sample app to load ads. Note that you need to add your Ad Unit ID in the Assets > Scripts > GoogleMobileAdsDemoScript.cs file.

Thanks,
Veer Busani
Mobile Ads SDK Team

On Friday, July 22, 2016 at 1:45:59 PM UTC-4, Abbas Rizvi wrote:
I don't know much about coding, I build my app using Playmaker.I copy this code from firebase.google.com attach it my camera but nothing shows up ,I request you to kindly use my ad id and use it build a sample app and tell me that it works or not.Because i don't know how to code.Hope you understand, sorry for my english.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/rywDPuG8u_I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.

Abbas Rizvi

unread,
Jul 24, 2016, 6:39:28 AM7/24/16
to google-adm...@googlegroups.com
Please Help!!!

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Jul 25, 2016, 10:54:56 AM7/25/16
to Google Mobile Ads SDK Developers
Hi Abbas,

Can you send us a sample app, which would reproduce the issue? My suspect is that you might not be linking the code as a proper GameObject component in your project. Also, here is a sample app that you can simply build and run to test the integration. Do test that app and let me know if you are able to build.

Thanks,
Veer Busani
Mobile Ads SDK Team

Please Help!!!


To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/rywDPuG8u_I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.

Abbas Rizvi

unread,
Jul 30, 2016, 4:46:18 AM7/30/16
to google-adm...@googlegroups.com
this is also not working its giving compiler error in the sample script


Please Help!!!


To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/rywDPuG8u_I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/rywDPuG8u_I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Aug 1, 2016, 10:11:10 AM8/1/16
to Google Mobile Ads SDK Developers
Hi Abbas,

What is the compiler error that you are receiving? It could mean that you have not updated to the latest Google Play Services and Android SDK Build Tools frameworks in your Android SDK Manager. Also make sure that you right click on the Assets > PlayServicesResolver folder and select Google Play Services > Resolve Client Jars, which would import all the necessary dependencies into the project. 

Thanks,
Veer Busani
Mobile Ads SDK Team

On Saturday, July 30, 2016 at 4:46:18 AM UTC-4, Abbas Rizvi wrote:
this is also not working its giving compiler error in the sample script

Please Help!!!


To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/rywDPuG8u_I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/rywDPuG8u_I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages