Unity 4.3.x, Google Mobile Ads inside Play Services

6,863 views
Skip to first unread message

Dario Lipari

unread,
Feb 16, 2014, 6:12:58 PM2/16/14
to google-adm...@googlegroups.com
Hi,

for the previous version of admob ads library (6.4.1) there was an official plugin for Unity.

Now that ads are inside Google Play Services, how can I use ads?

I need to create my JNI Wrapper? or there is a unity plugin from google, like the previous one that I don't have found?

Thanks
Dario

Eric Leichtenschlag

unread,
Feb 18, 2014, 1:02:37 PM2/18/14
to google-adm...@googlegroups.com
I'm working on releasing a play services version of the plugin, which I hope to release sometime next week.

In the meantime, if you wanted to do this yourself, it would involve updating AdMobPlugin.java with the Google Play services calls. Of course, you'll also need to include the Google Play services library project, and make a couple of slight alterations in your AndoridManifest.xml as described here.

Dario Lipari

unread,
Feb 20, 2014, 6:30:04 AM2/20/14
to google-adm...@googlegroups.com
Thanks, I'm waiting for your plugin new version.

Dario

Kai Gorschlüter

unread,
Feb 20, 2014, 11:16:49 AM2/20/14
to google-adm...@googlegroups.com
Hey Eric,

i´d really appreciate a new version too.
Will that plugin work with the free Unity version, or will i need the pro version?

Thx in advance

Kai
Message has been deleted
Message has been deleted

Eric Leichtenschlag

unread,
Feb 20, 2014, 1:04:18 PM2/20/14
to google-adm...@googlegroups.com
I just pushed out a Google Play services plugin that you can find at https://github.com/googleads/googleads-mobile-plugins/tree/master/unity/android. Let me know if this solves your problems.

@Giullo, we moved our samples from code.google.com to GitHub. The project that you're probably referring to with AdMobPlugin.java was the library project the library project at https://github.com/googleads/googleads-mobile-plugins/tree/master/unity/android-legacy/plugin-library. Now that the Google Play services version is pushed out, you may want to compare to the java file from the project in the first link above and see how yours compares.

Cheers,
Eric

On Thursday, February 20, 2014 9:02:49 AM UTC-8, Giulio Muntoni wrote:
I think my AdMobPlugin.java is ready but I don't know how to compile it and I can't find its project because I don't know where the android examples repository is. Can you help me? thanks


Il giorno martedì 18 febbraio 2014 19:02:37 UTC+1, Eric Leichtenschlag ha scritto:

Kai Gorschlüter

unread,
Feb 20, 2014, 1:22:57 PM2/20/14
to google-adm...@googlegroups.com
Great man! Works like a charm! Thx a ton!
Message has been deleted

Dimitris Kritikos

unread,
Feb 20, 2014, 4:03:08 PM2/20/14
to google-adm...@googlegroups.com
I tried it also with unity 4.3 pro and it works great. Thanks a million... !!!


On Thu, Feb 20, 2014 at 9:07 PM, Giulio Muntoni <gmud...@gmail.com> wrote:
Thanks!

But I have a problem, I ave both two google play services plugins: the GPG one for the game services and yours for admob. I already have a res folder under /Plugins/Android/ with a google-play-services.jar at the same levesl.
If I delete the double references it doesn't compile.

Error building Player: CommandInvokationFailure: Failed to re-package resources. See the Console for details.
C:\adt-bundle\sdk\build-tools\android-4.4\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/adt-bundle/sdk/platforms/android-19\android.jar" -F bin/resources.ap_ --extra-packages com.google.android.gms -S "C:\Users\Giulio\Unity Projects\game\Temp\StagingArea\android-libraries\google-play-services_lib\res"

stderr[
res\values\maps_attrs.xml:5: error: Attribute "mapType" has already been defined
res\values\maps_attrs.xml:12: error: Attribute "cameraBearing" has already been defined
res\values\maps_attrs.xml:13: error: Attribute "cameraTargetLat" has already been defined
res\values\maps_attrs.xml:14: error: Attribute "cameraTargetLng" has already been defined
res\values\maps_attrs.xml:15: error: Attribute "cameraTilt" has already been defined
res\values\maps_attrs.xml:16: error: Attribute "cameraZoom" has already been defined
res\values\maps_attrs.xml:17: error: Attribute "uiCompass" has already been defined
res\values\maps_attrs.xml:18: error: Attribute "uiRotateGestures" has already been defined
res\values\maps_attrs.xml:19: error: Attribute "uiScrollGestures" has already been defined
res\values\maps_attrs.xml:20: error: Attribute "uiTiltGestures" has already been defined
res\values\maps_attrs.xml:21: error: Attribute "uiZoomControls" has already been defined
res\values\maps_attrs.xml:22: error: Attribute "uiZoomGestures" has already been defined
res\values\maps_attrs.xml:23: error: Attribute "useViewLifecycle" has already been defined
res\values\maps_attrs.xml:24: error: Attribute "zOrderOnTop" has already been defined
]



Il giorno giovedì 20 febbraio 2014 19:22:57 UTC+1, Kai Gorschlüter ha scritto:
Great man! Works like a charm! Thx a ton!

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

Message has been deleted

Dario Lipari

unread,
Feb 20, 2014, 5:48:31 PM2/20/14
to google-adm...@googlegroups.com
Hi Eric,

your plugin work very well with your demo script.
But when you call

oogleMobileAdsPlugin.CreateBannerView("ca-app-pub-9380760713574559/3453176828",
                                               GoogleMobileAdsPlugin.AdSize.SmartBanner,
                                               true);


I don't understand how you compose your publisherID: in my AdMob page, my publisherID is a1530680a981dc1.

If I use my publisherID, Ad don't appear and in logcat I found an error 400 

02-20 23:39:43.195: W/Ads(1077): Received error HTTP response code: 400
02-20 23:39:43.195: W/Ads(29900): There was a problem getting an ad response. ErrorCode: 0
02-20 23:39:43.195: W/Ads(29900): Failed to load ad: 0

I suppose that my error is how I have composed my publisherID.

Can you explain me how can I do?

Thanks!
Dario

Dario Lipari

unread,
Feb 20, 2014, 6:08:31 PM2/20/14
to google-adm...@googlegroups.com
Sorry, I found what I need:


I need to wait 'cause Adsense verification.

Thanks ;)!
Message has been deleted

Dario Lipari

unread,
Feb 20, 2014, 6:19:25 PM2/20/14
to google-adm...@googlegroups.com
Thanks, but my admob dashboard seem to be the old version... so I don't have a publish ID like that one.

I found a link that show me the way ;)!

Dario

Il giorno venerdì 21 febbraio 2014 00:08:56 UTC+1, Giulio Muntoni ha scritto:
you have to pass the ad unit id you can create one for your app from the admob dashboard
Message has been deleted

Dario Lipari

unread,
Feb 20, 2014, 6:58:43 PM2/20/14
to google-adm...@googlegroups.com

I use also the google play game services plugin and it.work fine together

Il 21/feb/2014 00:39 "Giulio Muntoni" <gmud...@gmail.com> ha scritto:
by the way your plugin now works using only thethe manifest, the plugin .jar and the google play services .jar in Assets/Android but I can't use the other plugin together, it either causes problems when packing the resources or doesn't work at all.

Message has been deleted

Eric Leichtenschlag

unread,
Feb 20, 2014, 7:28:59 PM2/20/14
to google-adm...@googlegroups.com
If you are using Google Play Games plugin with the Google Play services version of the AdMob Plugin, when you complete the google play games setup it pulls in google-play-services_lib for you, so you don't need to put that in manually.

@Dario, as you noticed, I accidentally left my test ad unit ID in the plugin. I've just updated it to introduce a compile time error as a reminder to put in your own ad unit ID. For anyone else who checked out the new version of the plugin earlier today, make sure to update the demo script with your own ad unit!

Thanks,
Eric

On Thursday, February 20, 2014 3:58:43 PM UTC-8, Dario Lipari wrote:

I use also the google play game services plugin and it.work fine together

Il 21/feb/2014 00:39 "Giulio Muntoni" <gmud...@gmail.com> ha scritto:
by the way your plugin now works using only thethe manifest, the plugin .jar and the google play services .jar in Assets/Android but I can't use the other plugin together, it either causes problems when packing the resources or doesn't work at all.

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

Daniel Kiefer

unread,
Feb 21, 2014, 2:49:21 AM2/21/14
to google-adm...@googlegroups.com
Perfect , works like a charm!!

one question, for the iOS plugin is the banner top bottom position also fixed?




You received this message because you are subscribed to the Google Groups "Google AdMob Ads Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads...@googlegroups.com.

Dario Lipari

unread,
Feb 21, 2014, 4:56:10 AM2/21/14
to google-adm...@googlegroups.com
Hi,

I'm using https://github.com/playgameservices/play-games-plugin-for-unity as Google Play Game Services Plugin for Unity.

It is from another Googlers ;)

I have added Game Services plugin first and when I complete my games, I have added Google ads plugin from Eric and all works fine.

Dario

Il giorno venerdì 21 febbraio 2014 01:23:00 UTC+1, Giulio Muntoni ha scritto:
which one? are you targeting api19? thanks


Il giorno venerdì 21 febbraio 2014 00:58:43 UTC+1, Dario Lipari ha scritto:

I use also the google play game services plugin and it.work fine together

Il 21/feb/2014 00:39 "Giulio Muntoni" <gmud...@gmail.com> ha scritto:
by the way your plugin now works using only thethe manifest, the plugin .jar and the google play services .jar in Assets/Android but I can't use the other plugin together, it either causes problems when packing the resources or doesn't work at all.

--
 
---
You received this message because you are subscribed to a topic in the Google Groups "Google AdMob Ads Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/0t-5rHrHqlw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
Message has been deleted
Message has been deleted

Eric Leichtenschlag

unread,
Feb 21, 2014, 2:32:26 PM2/21/14
to google-adm...@googlegroups.com
The bug with iOS always showing at the top is still present. I'll try to push a fix to the GitHub project next week.

Thanks,
Eric

On Friday, February 21, 2014 3:29:50 AM UTC-8, Giulio Muntoni wrote:
On iOS in my case it shows only a banner on the top left whether I create a smart banner on the bottom or not 
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.

Ha Quang Tu

unread,
Feb 23, 2014, 1:45:07 PM2/23/14
to google-adm...@googlegroups.com
I tried with UNITY 4.3 and it work with play service plugin.
But when i open leaderboard and back to game , it is forced close . 
Please check for me my manifest . I think because it be forced close

<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.unity3d.player"
    android:installLocation="preferExternal"
    android:theme="@android:style/Theme.NoTitleBar"
    android:versionCode="1"
    android:versionName="1.0">
      <supports-screens
        android:smallScreens="true"
        android:normalScreens="true"
        android:largeScreens="true"
        android:xlargeScreens="true"
        android:anyDensity="true"/>
       
    <application
        android:icon="@drawable/app_icon"
        android:label="@string/app_name"
        android:debuggable="true">
       
         <!-- FB Plugin -->
        <activity android:name="com.facebook.unity.FBUnityPlayerActivity"
            android:launchMode="singleTask"
            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>
                 
                   <!-- Admob Plugin value="true" -->
            <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
        </activity>
       
        <!-- Common Plugin -->
        <activity android:name="com.unity3d.player.UnityPlayerNativeActivity"
                  android:launchMode="singleTask"
                  android:label="@string/app_name"
                  android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
        </activity>
       
        <activity android:name="com.unity3d.player.VideoPlayer"
            android:label="@string/app_name"
            android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" >
        </activity>
       
        <!-- Google Mobile Ads Activity -->
          <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>
       
        <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
        <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" >    
        </activity>
       
        <!-- FB Plugin -->
        <activity android:name="com.unity3d.player.UnityPlayerActivity"
            android:launchMode="singleTask"
            android:label="@string/app_name"
            android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
        </activity>
       
        <!-- FB Plugin -->
        <activity android:name="com.facebook.LoginActivity"
            android:configChanges="keyboardHidden|orientation">
        </activity>
       
        <!-- FB Plugin -->
        <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="\ 1399302573663486" />
       
    </application>
   
    <!-- permission -->
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>



Eric Leichtenschlag

unread,
Feb 24, 2014, 6:21:56 PM2/24/14
to google-adm...@googlegroups.com
Hello,

Do you have a stack trace for your crash? I don't see anything wrong with the manifest from the AdMob side.

Thanks,
Eric

Mark Karle

unread,
Mar 13, 2014, 3:47:14 AM3/13/14
to google-adm...@googlegroups.com
Hi, I imported the plugin, put the prefab into the scene, put in my ad unit id, and built it, but no ads are showing on my android device.  What else do i need to do?

Eric Leichtenschlag

unread,
Mar 14, 2014, 12:52:46 PM3/14/14
to google-adm...@googlegroups.com
Hi Mark,

Do you have any logcat output on what's happening? It would help to identify where the problem is. Does the demo script even start invoking the methods from the C# side? If so, what other ads-related errors are you seeing in the logs?

Thanks,
Eric

Mark Karle

unread,
Mar 14, 2014, 8:08:37 PM3/14/14
to google-adm...@googlegroups.com
When I run it in unity, it shows that the methods are called, but obviously the ads shouldn't show anyway and I get a JIT error.
When I run it in Android, the logs show the following: 
03-14 19:01:38.560  25375-25393/com.murner I/Unity Registering for AdMob Events
   
UnityEngine.Debug:Internal_Log(Int32, String, Object)
   
UnityEngine.Debug:Log(Object)
   
UnityEngine.MonoBehaviour:print(Object)
   
GoogleMobileAdsDemoScript:OnEnable() (at C:\Users\Mark\GitHub\Monkey-Game\Assets\Plugins\GoogleMobileAdsPlugin\GoogleMobileAdsDemoScript.cs:20)
   
(Filename: C Line: 0)
03-14 19:01:38.650  25375-25393/com.murner D/Unity Sensor :        Accelerometer ( 1) ; 0.000599 / 0.01s ; K330 3-axis Accelerometer / STMicroelectronics
03-14 19:01:38.650  25375-25393/com.murner I/Unity Started
   
UnityEngine.Debug:Internal_Log(Int32, String, Object)
   
UnityEngine.Debug:Log(Object)
   
UnityEngine.MonoBehaviour:print(Object)
   
GoogleMobileAdsDemoScript:Start() (at C:\Users\Mark\GitHub\Monkey-Game\Assets\Plugins\GoogleMobileAdsPlugin\GoogleMobileAdsDemoScript.cs:8)
   
(Filename: C Line: 0)
03-14 19:01:38.700  25375-25393/com.murner I/Unity Created Banner View
   
UnityEngine.Debug:Internal_Log(Int32, String, Object)
   
UnityEngine.Debug:Log(Object)
   
UnityEngine.MonoBehaviour:print(Object)
   
GoogleMobileAdsDemoScript:Start() (at C:\Users\Mark\GitHub\Monkey-Game\Assets\Plugins\GoogleMobileAdsPlugin\GoogleMobileAdsDemoScript.cs:12)
   
(Filename: C Line: 0)
03-14 19:01:38.700  25375-25393/com.murner I/Unity Requested Banner Ad
   
UnityEngine.Debug:Internal_Log(Int32, String, Object)
   
UnityEngine.Debug:Log(Object)
   
UnityEngine.MonoBehaviour:print(Object)
   
GoogleMobileAdsDemoScript:Start() (at C:\Users\Mark\GitHub\Monkey-Game\Assets\Plugins\GoogleMobileAdsPlugin\GoogleMobileAdsDemoScript.cs:14)
   
(Filename: C Line: 0)
03-14 19:01:39.110  25375-25375/com.murner D/dalvikvm DexOpt: --- BEGIN 'ads-1749486023.jar' (bootstrap=0) ---
03-14 19:01:39.220  25375-25375/com.murner D/dalvikvm DexOpt: --- END 'ads-1749486023.jar' (success) ---
03-14 19:01:39.220  25375-25375/com.murner D/dalvikvm DEX prep '/data/data/com.murner/cache/ads-1749486023.jar': unzip in 0ms, rewrite 118ms
03-14 19:01:39.250  25375-25375/com.murner I/Ads Use AdRequest.Builder.addTestDevice("C574F37D995C4828CF10F92378CC62C8") to get test ads on this device.
03-14 19:01:39.270  25375-25375/com.murner I/Ads Starting ad request.
03-14 19:01:39.310  25375-25375/com.murner I/webclipboard clipservice: android.sec.clipboard.ClipboardExManager@42da0838
03-14 19:01:39.360  25375-25375/com.murner E/webview registerForStylusPenEvent onAttachedToWindow
03-14 19:01:39.360  25375-25375/com.murner E/webview registerForStylusPenEvent START
03-14 19:01:39.360  25375-25375/com.murner E/webview registerForStylusPenEvent END
03-14 19:01:39.390  25375-25375/com.murner D/WebView onSizeChanged - w:1080 h:150
03-14 19:01:39.400  25375-25483/com.murner E/GooglePlayServicesUtil The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
03-14 19:01:39.410  25375-25477/com.murner V/webkit BrowserFrame constructor: this=Handler (android.webkit.BrowserFrame) {42d9fac8}
03-14 19:01:39.471  25375-25483/com.murner E/GooglePlayServicesUtil The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
03-14 19:01:39.471  25375-25382/com.murner I/dalvikvm Total arena pages for JIT: 11
03-14 19:01:39.471  25375-25382/com.murner I/dalvikvm Total arena pages for JIT: 12
03-14 19:01:39.471  25375-25382/com.murner I/dalvikvm Total arena pages for JIT: 13
03-14 19:01:39.471  25375-25483/com.murner E/GooglePlayServicesUtil The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
03-14 19:01:56.847  25375-25375/com.murner I/Unity onPause
03-14 19:01:56.867  25375-25393/com.murner D/Unity Sensor :        Accelerometer ( 1) ; 0.000599 / 0.01s ; K330 3-axis Accelerometer / STMicroelectronics
03-14 19:02:39.479  25375-25483/com.murner W/Ads Timed out waiting for ad response.
03-14 19:02:39.479  25375-25477/com.murner E/SQLiteLog﹕ (14) cannot open file at line 32512 of [00bb9c9ce4]
03-14 19:02:39.479  25375-25477/com.murner E/SQLiteLog﹕ (14) os_unix.c:32512: (2) open(/NotificationPermissions.db) -
03-14 19:02:39.479  25375-25477/com.murner D/WebKit﹕ ERROR:
03-14 19:02:39.479  25375-25477/com.murner D/WebKit﹕ SQLite database failed to load from /NotificationPermissions.db
    Cause - unable to open database file
03-14 19:02:39.479  25375-25477/com.murner D/WebKit﹕ [ 03-14 19:02:39.479 25375:25477 D/WebKit   ]
    external/webkit/Source/WebCore/platform/sql/SQLiteDatabase.cpp(71) : bool WebCore::SQLiteDatabase::open(const WTF::String&, bool)
03-14 19:02:39.479  25375-25375/com.murner I/Ads﹕ Scheduling ad refresh 60000 milliseconds from now.
03-14 19:02:39.479  25375-25375/com.murner W/Ads﹕ Failed to load ad: 2
03-14 19:03:39.498  25375-25375/com.murner I/Ads﹕ Starting ad request.
03-14 19:03:39.508  25375-25375/com.murner I/webclipboard﹕ clipservice: android.sec.clipboard.ClipboardExManager@42da0838
03-14 19:03:39.518  25375-25477/com.murner V/webkit﹕ BrowserFrame constructor: this=Handler (android.webkit.BrowserFrame) {42e90da8}
03-14 19:03:39.568  25375-25375/com.murner E/webview﹕ registerForStylusPenEvent onAttachedToWindow
03-14 19:03:39.568  25375-25375/com.murner E/webview﹕ registerForStylusPenEvent START
03-14 19:03:39.568  25375-25375/com.murner E/webview﹕ registerForStylusPenEvent END
03-14 19:03:39.598  25375-25483/com.murner E/GooglePlayServicesUtil﹕ The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
03-14 19:03:39.688  25375-25483/com.murner E/GooglePlayServicesUtil﹕ The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
03-14 19:03:39.708  25375-25483/com.murner E/GooglePlayServicesUtil﹕ The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
03-14 19:04:39.696  25375-25483/com.murner W/Ads﹕ Timed out waiting for ad response.
03-14 19:04:39.706  25375-25477/com.murner E/SQLiteLog﹕ (14) cannot open file at line 32512 of [00bb9c9ce4]
03-14 19:04:39.706  25375-25477/com.murner E/SQLiteLog﹕ (14) os_unix.c:32512: (2) open(/NotificationPermissions.db) -
03-14 19:04:39.706  25375-25477/com.murner D/WebKit﹕ ERROR:
03-14 19:04:39.706  25375-25477/com.murner D/WebKit﹕ SQLite database failed to load from /NotificationPermissions.db
    Cause - unable to open database file
03-14 19:04:39.706  25375-25477/com.murner D/WebKit﹕ [ 03-14 19:04:39.706 25375:25477 D/WebKit   ]
    external/webkit/Source/WebCore/platform/sql/SQLiteDatabase.cpp(71) : bool WebCore::SQLiteDatabase::open(const WTF::String&, bool)
03-14 19:04:39.716  25375-25375/com.murner I/Ads﹕ Scheduling ad refresh 60000 milliseconds from now.
03-14 19:04:39.716  25375-25375/com.murner W/Ads﹕ Failed to load ad: 2
03-14 19:05:39.775  25375-25375/com.murner I/Ads﹕ Starting ad request.
03-14 19:05:39.805  25375-25375/com.murner D/WebView﹕ loadUrlImpl: called
03-14 19:05:39.805  25375-25477/com.murner D/webcore﹕ CORE loadUrl: called
03-14 19:05:39.805  25375-25477/com.murner D/webkit﹕ Firewall not null
03-14 19:05:39.805  25375-25477/com.murner D/webkit﹕ euler: isUrlBlocked = false
03-14 19:05:39.885  25375-25477/com.murner I/GATE﹕ <GATE-M>DEV_ACTION_COMPLETED</GATE-M>
03-14 19:05:39.895  25375-25483/com.murner E/GooglePlayServicesUtil﹕ The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
03-14 19:05:39.985  25375-25483/com.murner E/GooglePlayServicesUtil﹕ The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
03-14 19:05:40.005  25375-25483/com.murner E/GooglePlayServicesUtil﹕ The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.


Eric Leichtenschlag

unread,
Mar 14, 2014, 8:13:10 PM3/14/14
to google-adm...@googlegroups.com
Hey Mark,

From those logs, I'm seeing "Timed out waiting for ad response." and "Failed to load ad: 2" which indicates a network error. So the plugin is working correctly but you must not have a good internet connection.

Thanks,
Eric
03-14 19:01:39.400  25375-25483<span style="color: #660
...

Mark Karle

unread,
Mar 14, 2014, 9:13:53 PM3/14/14
to google-adm...@googlegroups.com
It's strange because my phone has complete internet access. So that got me thinking my app wasn't connecting to the internet. I looked in my android manifest file and saw at the top
package="com.example.admobtest"
so I tried changing it to the name of the package my game is based in. Still a network error.  
Could the error 
The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
be a problem? 
Thanks for helping by the way

Lockon302

unread,
Mar 14, 2014, 10:21:24 PM3/14/14
to google-adm...@googlegroups.com
Hello,

Could I please ask if the actual new AdMob IDs work with the current version of the Unity AdMob package v.1.1 for iOS?
In the package for iOS there's "a14e41ba0bac41b" as PublisherID example, but now with the new AdMob the IDs are "ca-app-pub-1234567890/123456..."

As soon as I put my ID there Ads don't show.

Thank you.

Andre Arsenault

unread,
Mar 15, 2014, 6:19:46 AM3/15/14
to google-adm...@googlegroups.com
Hi Mark,

Can you verify that you have copied the "res" folder from google-play-services_lib into your app's Plugins/Android folder? The error message you quoted makes me think you might be missing that folder.

You should have:
  • google-play-services.jar (from %ANDROID_SDK_ROOT%/extras/google/google_play_services/libproject/google-play-services_lib/libs) under Plugins/Android/libs
and
  • the whole contents of the res folder (from %ANDROID_SDK_ROOT%/extras/google/google_play_services/libproject/google-play-services_lib/res) under Plugins/Android/res.

You may need to do a manual merge of some files if you already have them customized for your project (such as res/values/string.xml for example).

Andre

Mark Karle

unread,
Mar 15, 2014, 2:52:48 PM3/15/14
to google-adm...@googlegroups.com
Hey Andre,
Thanks. I still haven't gotten it to work, but I had those files under Plugins/Android/google-play-services_lib. I moved them to the Android folder along with all the other files in goolge-play-services_lib. Was that the right move? There are now two AndroidManifest.xml files in Plugins/Android. Still no ads though.
Message has been deleted

Eric Leichtenschlag

unread,
Mar 17, 2014, 10:00:58 PM3/17/14
to google-adm...@googlegroups.com
It's easiest just to include the entire google-play-services_lib/ folder inside of Plugins/Android. The fact that the request was made means everything was set up correctly. Just sometimes the device doesn't want to connect to the internet for some reason - I've seen similar issues using the SDK directly, which leads me to believe the Unity plugin itself is not the problem.

Can you try clearing app data and re-installing?

Thanks,
Eric

Mark Karle

unread,
Mar 18, 2014, 3:44:08 AM3/18/14
to google-adm...@googlegroups.com
Hi Eric,
I tried that with no luck.  But I just noticed in logcat this line:
Use AdRequest.Builder.addTestDevice(...) to get test ads on this device.
Where should I add test device in my code?

Eric Leichtenschlag

unread,
Mar 20, 2014, 12:07:20 PM3/20/14
to google-adm...@googlegroups.com
There isn't support for adding test devices through a Unity script. You'd have to edit the plugin's Android project and add it here and rebuild.

That said, you should be getting ads without the need of a test device. I'm not sure why you wouldn't be getting ads back normally. If you'd like, you can send me your apk and I can run it to see if I'm getting ads on my side.

Thanks,
Eric

Iván Fernández

unread,
Mar 23, 2014, 8:39:21 AM3/23/14
to google-adm...@googlegroups.com
Hi Eric, 
I've been creating a new game using Unity and was trying to implement your plugin to put ads. But everytime I try to build it it givew me this error 

Error building Player: CommandInvokationFailure: Failed to re-package resources. See the Console for details.
D:\Program Files (x86)\adt-bundle-windows-x86_64-20131030\sdk\build-tools\android-4.4\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "D:/Program Files (x86)/adt-bundle-windows-x86_64-20131030/sdk/platforms/android-19\android.jar" -F bin/resources.ap_ --extra-packages  -S "D:\Usuarios\Ivan\Documents\SideScroller\Temp\StagingArea\android-libraries\google-play-services_lib\res"

stderr[
D:\Usuarios\Ivan\Documents\SideScroller\Temp\StagingArea\android-libraries\google-play-services_lib\res\values\strings.xml: error: Duplicate file.
res\values\strings.xml: Original is here.
]
stdout[
Processing raw dir 'D:\Usuarios\Ivan\Documents\SideScroller\Temp\StagingArea\android-libraries\google-play-services_lib\res'
]

I have the the plugins forder with the Android and the GoogleMobileAdsPlugin folder inside. And the Google Play Services lib folder inside the Android one. How could I solve this problem?

Thanks, Ivan

Eric Leichtenschlag

unread,
Mar 24, 2014, 3:23:30 PM3/24/14
to google-adm...@googlegroups.com
Hello Ivan,

From the error, the directory D:\Usuarios\Ivan\Documents\SideScroller\Temp\StagingArea\android-libraries\google-play-services_lib\res doesn't look like it's in Plugins/Android.

Mark Karle

unread,
Mar 25, 2014, 4:19:15 AM3/25/14
to google-adm...@googlegroups.com
Hi Eric, 
Sorry for all the headache earlier! The problem was with my device. I think the ROM I have blocks admob. But the plugin works on other phones. Thanks!

Iván Fernández

unread,
Mar 25, 2014, 1:41:51 PM3/25/14
to google-adm...@googlegroups.com
Hello Eric, 

Thank you for replying so quickly but I got a new error after reimporting everything: 

Error building Player: Win32Exception: ApplicationName='C:\Program Files (x86)\Java\jre7\bin\javac.exe', CommandLine='-bootclasspath "D:/Program Files (x86)/adt-bundle-windows-x86_64-20131030/sdk/platforms/android-19\android.jar" -d "D:\Usuarios\Ivan\Documents\SideScroller\Temp\StagingArea\bin\classes" -source 1.6 -target 1.6 -encoding ascii "com\google\android\gms\R.java" "com\Laboravit\Tech\R.java"', CurrentDirectory='D:\Usuarios\Ivan\Documents\SideScroller\Temp\StagingArea\gen'

I'm sorry but I can't understand this errors.

Mark Karle

unread,
Mar 25, 2014, 8:44:41 PM3/25/14
to google-adm...@googlegroups.com

Actually one more thing. For the iOS ads, I set the position to false so that the ads will go to the bottom, but they stay at the top. How can I fix this?

--

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

Mark Karle

unread,
Mar 25, 2014, 10:46:16 PM3/25/14
to google-adm...@googlegroups.com
For bottom ads on iOS, I used the change that andre-arsenault made on the github


--

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

Eric Leichtenschlag

unread,
Mar 26, 2014, 4:55:39 PM3/26/14
to google-adm...@googlegroups.com
Hi Ivan,

com\google\android\gms\R.java is a generated file, probably in google-play-services_lib/gen. Try removing the entire bin/ and gen/ directories from google-play-services_lib if they're in there.

Thanks,
Eric
Message has been deleted

Bopa Bopa

unread,
Mar 28, 2014, 3:39:26 AM3/28/14
to google-adm...@googlegroups.com
Hi,
I downloaded the android plugin for unity from https://github.com/googleads/googleads-mobile-plugins/tree/master/unity/android link.
As per the instructions given I integrated the plugin and everything working fine.

The main problem is ads are visible very late may be more than a minutes delay is there.

I am using ADMOB_PUBLISHER_ID = "a15******b4c13a";

Can you please suggest what could be the reason for this.

I tried data connection and wifi connection but same problem.

Thanks,
Bopa


mohsin khan

unread,
Mar 28, 2014, 2:15:42 PM3/28/14
to google-adm...@googlegroups.com
Hey Eric,

I'm using Unity 4.3f and want to integrate Admob Interstitial Ads. I seen your updated new Unity Plugin, but it don't show Interstitial ads (looks like it is made just for banner ads).
How i can show Interstitial Ads in my Unity game?

Also, if i use any other Admob Unity plugin for showing Interstitial Ads, then ads displayed after a long time and mostly never displayed. Also, consumes much resources.

So, it will be better if Google provide an Interstitial & Banner Ad plugin of Admob itself, means you...!!! :)

Thanks
Mohsin

mohsin khan

unread,
Mar 28, 2014, 2:20:05 PM3/28/14
to google-adm...@googlegroups.com
Forgot to say that, i'm looking for Admob Interstitial & Banner Ads Unity plugin for Android.

Eric Leichtenschlag

unread,
Mar 28, 2014, 5:46:56 PM3/28/14
to google-adm...@googlegroups.com
Hi Bopa,

In Google Play services some people have noticed a weird issue where the first ad didn't show. But in the plugin, this line of code to set the background color somehow works around it. The compiled version should have this fix for you already. In LogCat, are you seeing the first ad request complete quickly? If not, maybe it is just your connection.

Thanks,
Eric

Eric Leichtenschlag

unread,
Mar 28, 2014, 5:49:12 PM3/28/14
to google-adm...@googlegroups.com
Mohsin,

I do plan on adding interstitial support, but I haven't had time to do it yet. In the meantime, one of your fellow AdMob developers created his own version of an AdMob Unity plugin that he says supports interstitials. I haven't tried it myself, but you could check it out if you want this feature now.

Thanks,
Eric

Bopa Bopa

unread,
Mar 29, 2014, 5:39:23 AM3/29/14
to google-adm...@googlegroups.com
Thanks Eric,
The link you provided is not working. If you are refering  to this line plugin.adView.setBackgroundColor(Color.TRANSPARENT); then it is already there in code.
Or you suggest something else.

Bopa

unbounded

unread,
Mar 29, 2014, 12:04:42 PM3/29/14
to google-adm...@googlegroups.com
I already tried this plugin, but it can't be used in final version of the app. As, it shows many Toast messages and looks like it consumes much resources, if i set its frequency and don't choose to be shown only on ApplicationLoad. Also, ad retrieval is too slow in it.

Better if you plan to make it in near future. :)
Also, it will be more better if you make a single plugin for both Interstitial and Banner Ads, please.

Thanks
Mohsin



On Sat, Mar 29, 2014 at 2:49 AM, Eric Leichtenschlag <eleich...@google.com> wrote:
Mohsin,

I do plan on adding interstitial support, but I haven't had time to do it yet. In the meantime, one of your fellow AdMob developers created his own version of an AdMob Unity plugin that he says supports interstitials. I haven't tried it myself, but you could check it out if you want this feature now.

Thanks,
Eric


On Friday, March 28, 2014 11:20:05 AM UTC-7, mohsin khan wrote:
Forgot to say that, i'm looking for Admob Interstitial & Banner Ads Unity plugin for Android.


On Friday, March 28, 2014 11:15:42 PM UTC+5, mohsin khan wrote:
Hey Eric,

I'm using Unity 4.3f and want to integrate Admob Interstitial Ads. I seen your updated new Unity Plugin, but it don't show Interstitial ads (looks like it is made just for banner ads).
How i can show Interstitial Ads in my Unity game?

Also, if i use any other Admob Unity plugin for showing Interstitial Ads, then ads displayed after a long time and mostly never displayed. Also, consumes much resources.

So, it will be better if Google provide an Interstitial & Banner Ad plugin of Admob itself, means you...!!! :)

Thanks
Mohsin


On Thursday, February 20, 2014 11:04:18 PM UTC+5, Eric Leichtenschlag wrote:
I just pushed out a Google Play services plugin that you can find at https://github.com/googleads/googleads-mobile-plugins/tree/master/unity/android. Let me know if this solves your problems.

@Giullo, we moved our samples from code.google.com to GitHub. The project that you're probably referring to with AdMobPlugin.java was the library project the library project at https://github.com/googleads/googleads-mobile-plugins/tree/master/unity/android-legacy/plugin-library. Now that the Google Play services version is pushed out, you may want to compare to the java file from the project in the first link above and see how yours compares.

Cheers,
Eric


--

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



--
A MAN CAN BE DESTROYED BUT CAN NEVER BE DEFEATED
Register on http://cslearners.blogspot.com/ 

Eric Leichtenschlag

unread,
Mar 31, 2014, 1:02:24 PM3/31/14
to google-adm...@googlegroups.com
Hi Bopa,

I just pushed out a unified version of the Unity plugin on Friday that includes Android/iOS in one bundle, and addresses several bugs including adding that transparency line. The directory structure of the plugin changed, so unfortunately it has broken any of the links from the old plugin. I'd highly recommend you try the new plugin, I think you'll find the integration experience much better. The plugin can be found here and also includes a small sample app.

Thanks,
Eric 

Bopa Bopa

unread,
Apr 1, 2014, 12:22:45 AM4/1/14
to google-adm...@googlegroups.com
Thanks Eric,
I will use the plugin and let you know if any issues are there.

Bopa

Bopa Bopa

unread,
Apr 1, 2014, 12:30:29 AM4/1/14
to google-adm...@googlegroups.com
Thanks Eric,
I will use the plugin and let you know if any issues are there. But can you please add the download link on the page?

Eric Leichtenschlag

unread,
Apr 1, 2014, 9:56:34 PM4/1/14
to google-adm...@googlegroups.com
Hi Bopa,

The .unitypackage for the plugin can be found at https://github.com/googleads/googleads-mobile-plugins/releases/tag/v2.0. To get the sample, you'll need to either clone or download the repository.

Thanks,
Eric

Robert Lawrence

unread,
Apr 5, 2014, 1:54:46 PM4/5/14
to google-adm...@googlegroups.com
Hi Eric,
This line <activity android:name="com.google.unity.EricTestActivity"/> in the plugin manifest file, do we leave that or change it?
 
Thank you.

Eric Leichtenschlag

unread,
Apr 7, 2014, 4:47:49 PM4/7/14
to google-adm...@googlegroups.com
Hi Robert,

Oops, that shouldn't be there. I was running a test and forgot to take that activity out. Feel free to remove it.

Thanks,
Eric
Message has been deleted

Nicholas Rafalski

unread,
Apr 9, 2014, 2:28:16 PM4/9/14
to google-adm...@googlegroups.com
Hi Eric,

I'm very grateful that you've continued to support this plugin after the initial publish. I integrated the Android only plugin last month, and am excited to use the combined  Android/iOS updated version now that my game supports iOS!

However, I am also anxiously awaiting your interstitial support. Can you give any estimate on a timeline for that feature? If you do not expect an update anytime soon, would it be possible for you to share your eclipse project (or however you're generating the jar)? I'm not even sure what the equivalent object would be for the iOS version.

Also, can you speculate at all if it that update would cause similar directory-structure changes that would cause us to need to re-integrate the plugin? Depending on the answer, I may wait to integrate the unified iOS/Android plugin until there is interstitial support. 

Hopefully my tone came across as appreciative yet excited, not impatient!

Thanks,
Nick R

Eric Leichtenschlag

unread,
Apr 9, 2014, 8:06:36 PM4/9/14
to google-adm...@googlegroups.com
Hey Nick,

I want to have a new version with interstitital support pushed out by the end of April. It will build off of v2.0 and not introduce any major breaking changes like the move from v1 to v2. The only small API change I foresee is using EventHandler<EventArgs> on Ad events instead of Actions, which will slightly change the callback syntax for those registering for these events.

I learned a lot about Unity since writing v1, and v2 was a much needed makeover. Future iterations will continue to build off v2.

Thanks,
Eric

Levi Rosol

unread,
Apr 13, 2014, 6:21:49 PM4/13/14
to google-adm...@googlegroups.com
I put together a quick walkthrough using the v2 build that Eric mentioned. As a newb Unity / Android / iOS dev, I ran into a couple problems that cost me a couple hours time to figure out, so I figured documenting those and the fix would be beneficial for everyone.


As always, let me know if I missed anything or need to clarify.

Bopa Bopa

unread,
Apr 16, 2014, 5:46:49 AM4/16/14
to google-adm...@googlegroups.com
Thanks Eric,
The updated version is working like a Charm.

Keep doing the good work.

Bopa

Zara Ali

unread,
Apr 25, 2014, 1:03:01 AM4/25/14
to google-adm...@googlegroups.com
Hi,

When the plugin is available with the interstitial ads?

Regards,
Zara Ali

RedOne Lab

unread,
Apr 25, 2014, 8:05:01 AM4/25/14
to google-adm...@googlegroups.com
Hello in my project I am using play-games-plugin-for-unity how can I use it with this plugin pls help me!

Eric Leichtenschlag

unread,
Apr 25, 2014, 4:16:24 PM4/25/14
to google-adm...@googlegroups.com
Interstitial support for the plugin is coming soon. I hope to push it out by end of next week.

If you're already using the play games plugin for Unity, then you still should follow all the steps outlined in https://github.com/googleads/googleads-mobile-plugins/blob/master/unity/README.md. You probably already have the google play services jar included in your project, so that's one less step you have to follow to integrate Google Mobile Ads.

Thanks,
Eric

RedOne Lab

unread,
Apr 28, 2014, 1:56:29 PM4/28/14
to google-adm...@googlegroups.com
Still not working. Manifests merged succesfully.

Eric Leichtenschlag

unread,
Apr 28, 2014, 2:07:19 PM4/28/14
to google-adm...@googlegroups.com
Can you post your manifest XML?

RedOne Lab

unread,
Apr 29, 2014, 12:22:28 AM4/29/14
to google-adm...@googlegroups.com
Enter code here...<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" package="com.example.admobtest" android:versionName="1.0" android:versionCode="1">
 
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
 
<!-- Google Mobile Ads Permissions -->
   
<uses-permission android:name="android.permission.INTERNET" />
   
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
 
<application android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="false">
   
<!-- meta-data tag for Google Play services -->
   
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
   
<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" >
   
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
     
<intent-filter>
       
<action android:name="android.intent.action.MAIN" />
       
<category android:name="android.intent.category.LAUNCHER" />
     
</intent-filter>
    </
activity>
   
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" >
   
</activity>
    <activity android:name="com.unity3d.player.UnityPlayerNativeActivity" android:label="@string/
app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" >
      <meta-data android:name="
unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
      <meta-data android:name="
android.app.lib_name" android:value="unity" />
     
    </activity>
    <activity android:name="
com.unity3d.player.VideoPlayer" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" >
    </activity>
    <!-- Google Mobile Ads Activity -->
      <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>
  </application>
  <uses-feature android:glEsVersion="
0x00020000" />
  <uses-sdk android:minSdkVersion="
9" android:targetSdkVersion="19" />
</manifest>
Ads Manifest
Enter code here...<?xml version="1.0" encoding="utf-8"?>
<!-- This file was automatically generated by the Google Play Games plugin for Unity
     
Do not edit. -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
   
package="com.google.example.games.mainlibproj"
    android
:versionCode="1"
    android
:versionName="1.0" >
   
   
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="19" />
 
   
<application>
       
<meta-data android:name="com.google.android.gms.games.APP_ID"
                android
:value="\ 565680008778" />
       
<meta-data android:name="com.google.android.gms.appstate.APP_ID"
                android
:value="\ 565680008778" />
       
<meta-data android:name="com.google.android.gms.version"
                android
:value="@integer/google_play_services_version" />
       
<activity android:name="com.google.example.games.pluginsupport.SignInHelperActivity"
                android
:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
       
<activity android:name="com.google.example.games.pluginsupport.SelectOpponentsHelperActivity"
                android
:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
       
<activity android:name="com.google.example.games.pluginsupport.InvitationInboxHelperActivity"
                android
:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />

   
</application>
</
manifest>


Play Services manifest

Lorie-Jay Gutierrez

unread,
Apr 29, 2014, 6:06:16 AM4/29/14
to google-adm...@googlegroups.com
Hello Eric,

I'm new to Unity and Android development. I tried building your HelloWorld project but at first it had errors, because the main camera's script is missing. I assigned "GoogleMobileAdsDemoScript.cs" and edited the Ad Unit, as well as the Test Device ID. During runtime the banner doesn't show up. Here's the log for your reference:

C:\Android SDK\sdk\platform-tools>adb logcat -s Unity Ads
--------- beginning of /dev/log/main
--------- beginning of /dev/log/system
I/Ads     ( 1425): Starting ad request.
E/Ads     ( 1425): JS: Uncaught SyntaxError: Unexpected string (http://googleads
.g.doubleclick.net/mads/static/formats/templates.js:14)
E/Ads     ( 1425): JS: Uncaught ReferenceError: renderAd is not defined (http://
googleads.g.doubleclick.net/mads/gma:1)
E/Ads     ( 1425): JS: Uncaught ReferenceError: onLoad is not defined (http://go
ogleads.g.doubleclick.net/mads/gma:1)
W/Ads     ( 1425): An ad refresh is already scheduled.
I/Ads     ( 1425): Ad finished loading.
I/Unity   ( 1425): HandleAdLoaded event received.
I/Unity   ( 1425):
I/Unity   ( 1425): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDeb
ug.cpp Line: 53)
I/Unity   ( 1425):

The error is encountered when I press the Request Ad button. By the way, the Ad Unit I used is my own one. I created an temp app and ad unit for testing.

Regards,
L J

Eric Leichtenschlag

unread,
Apr 30, 2014, 5:28:05 PM4/30/14
to google-adm...@googlegroups.com
@RedOne lab,

The manifests do look fine. Where are you having your error? Does the app compile? If so do you have any relevant logs?

@Lorie-Jay,

From the Unity plugin side, everything looks fine. Some of those JS errors happen temporarily if you have a bad cache of a JS file that the Google Mobile Ads SDK uses. Can you try to clear app cache and try again, or try a different device?

Thanks,
Eric

RedOne Lab

unread,
Apr 30, 2014, 7:35:13 PM4/30/14
to google-adm...@googlegroups.com
Problem solved, the error was with ad unit id. Thanks Eric.

M Sahil

unread,
May 5, 2014, 8:14:24 AM5/5/14
to google-adm...@googlegroups.com
Hi Eric,

Any update on interstitial support, we are eagerly waiting for this.

thanks,
sahil

Eric Leichtenschlag

unread,
May 5, 2014, 7:29:59 PM5/5/14
to google-adm...@googlegroups.com
Will be ready later this week, if not tomorrow.

Eric Leichtenschlag

unread,
May 8, 2014, 8:19:47 PM5/8/14
to google-adm...@googlegroups.com

Nicholas Rafalski

unread,
May 8, 2014, 11:43:36 PM5/8/14
to google-adm...@googlegroups.com

Awesome Eric! Updating and Integrating it into my current project was easy. I've verified it works on Android, will do ios tomorrow.

Thanks!

Lorie-Jay Gutierrez

unread,
May 14, 2014, 3:26:11 AM5/14/14
to google-adm...@googlegroups.com
Hi Eric,

Thanks, I got everything working eventually. I just want to know how to do this more efficiently. As it is right now my game suffers more than 15FPS hit when the banner is visible. Actually, even after I hide it, the framerate doesn't pick up. It seems to be doing an internal refresh, as I see on logcat.

Regards,
L J

Eric Leichtenschlag

unread,
May 14, 2014, 1:54:05 PM5/14/14
to google-adm...@googlegroups.com
I don't know how to improve performance when the banner is visible. I think that's just the side effect of the addition of a WebView.

If you're talking about performance on Android specifically, note that when the banner is hidden the plugin pauses the AdView, and the Mobile Ads SDK will call WebView.onPause() to pause the WebView. WebView.pause() doesn't seem to actually pause everything though, which is an Android issue. For example, I still see text animations if I call adView.pause() but still show the adView.

If you don't have any other WebView's in your app, you can modify the plugin code to call WebView.pauseTimers() when the banner is hidden, and WebView.resumeTimers() which affects all WebViews and actually turns off animations and everything. The plugin doesn't already do this though because it could affect other WebViews and so this workaround may not work for all apps.

Thanks,
Eric

Neil Unadkat

unread,
May 16, 2014, 11:12:21 AM5/16/14
to google-adm...@googlegroups.com
Hey,

Am relatively new to Unity and Android. 
I followed the instructions given on the GitHub readme page, and added a Banner Ad view and called the LoadAd method.
If I run the game on the Unity editor, I can see in the Console that it calls the dummy client.

Once I load the game on the phone, I don't see any banners showing up.
Do I have have to do anything extra apart from minimal code given on the documentation?

Eric Leichtenschlag

unread,
May 16, 2014, 6:08:57 PM5/16/14
to google-adm...@googlegroups.com
Are you passing a valid ad unit ID when you create a banner view? What are you seeing in the logs on your phone? There should be an error reason when the ad request fails.

Thanks,
Eric

Neil Unadkat

unread,
May 18, 2014, 6:24:43 AM5/18/14
to google-adm...@googlegroups.com
I have double checked the ad unit ID. 
The problem is that, when I try to debug the game on either my phone, or the emulator, through unity the game does not load. (using the build and run option).

The game runs fine if I build an apk and install through that.
Hence I do not have a way to see the logs on the phone..

Neil Unadkat

unread,
May 18, 2014, 6:38:06 AM5/18/14
to google-adm...@googlegroups.com
This is the script which I attached to a GameObject on the scene.

public class MyAdMobClass : MonoBehaviour {

    // Use this for initialization
    private BannerView bannerView;
    private bool adLoaded;
    void Start () {
        bannerView = new BannerView ("my-Admob-ID",AdSize.SmartBanner,AdPosition.Top);
        
//        bannerView.AdFailedToLoad += (obj) => {adLoaded = false;};
//        bannerView.AdLoaded += () => {adLoaded = true;};
        AdRequest request = new AdRequest.Builder().Build();
        bannerView.LoadAd (request);
        bannerView.Show ();
    }

}

Is there anything else that I need to do?

Neil Unadkat

unread,
May 18, 2014, 7:53:37 AM5/18/14
to google-adm...@googlegroups.com
Hey Eric,

Figured out the issue. 
I am using GIT, and so when I checked out a different branch, the Google Play Lib Services was not available in that branch. 
After adding the folder it worked out. 

Thanks for your reply :)

Eric Leichtenschlag

unread,
May 19, 2014, 7:58:50 PM5/19/14
to google-adm...@googlegroups.com
No problem, glad you got it working!

Thanks,
Eric

Craig Carlson

unread,
Jun 4, 2014, 5:46:33 PM6/4/14
to google-adm...@googlegroups.com
Hi, I'm trying to get ads to work with the unity plugin but I keep seeing this error in logcat:

W/Ads     ( 9562): Received error HTTP response code: 400
W/Ads     ( 3578): There was a problem getting an ad response. ErrorCode: 0
W/Ads     ( 3578): Failed to load ad: 0

Help is much appreciated.

Eric Leichtenschlag

unread,
Jun 5, 2014, 3:51:24 PM6/5/14
to google-adm...@googlegroups.com
Can you try running it again? It takes some time for newly created ad units to start serving.

Thanks,
Eric

Craig Carlson

unread,
Jun 5, 2014, 4:20:20 PM6/5/14
to google-adm...@googlegroups.com
I ran it again, same error. How long does it take for newly created ad units to start serving? I've been having this problem for a few days now.

Eric Leichtenschlag

unread,
Jun 5, 2014, 4:46:21 PM6/5/14
to google-adm...@googlegroups.com
Should be ready within an hour, so that isn't your problem then. Can you get test ads back? You can add test ads by calling adRequest.addTestDevice, with the test device ID found in LogCat when making a live ad request.

Thanks,
Eric

Eric Leichtenschlag

unread,
Jun 5, 2014, 4:48:03 PM6/5/14
to google-adm...@googlegroups.com
And in Unity, that API would be new AdRequest.Builder().AddTestDevice("device_id").Build();

Craig Carlson

unread,
Jun 5, 2014, 5:45:52 PM6/5/14
to google-adm...@googlegroups.com
Hi Eric, I haven't even been able to get test ads working. My code is basically the same as what you said to do, but it still gives me that error. The demo script also gives me that error so I think it might be a problem with admob.

Eric Leichtenschlag

unread,
Jun 5, 2014, 9:18:01 PM6/5/14
to google-adm...@googlegroups.com
Could you package up a small Unity app (could be a copy of the HelloWorld sample if you'd like) with your integration and ad unit ID failing? I'll take a look and try to figure out what's going on.

Thanks,
Eric

Craig Carlson

unread,
Jun 5, 2014, 9:44:03 PM6/5/14
to google-adm...@googlegroups.com
Hi Eric, I've attached a package containing the demo script which gives me that error. I have a feeling the problem might lie in the android manifest file because I'm new to this sort of thing and don't know if it's configured properly.
problem_demo_Craig_Carlson.unitypackage

Eric Leichtenschlag

unread,
Jun 6, 2014, 2:53:25 PM6/6/14
to google-adm...@googlegroups.com
Hi Craig,

The .unitypackage you provided had everything but the Assets/Plugins/ part of the GoogleMobileAds.unitypackage. I created a new project, imported your package, imported the Assets/Plugins/Android files from the GoogleMobileAds.unitypackage (which your package was missing), and also added the Google Play services library into Assets/Plugins/Android. I was able to run without any code changes and get banner and interstitial ads back. The full Unity project was too big to attach, so I've just attached the extra files you were missing. Normally you'd get the Google Play services library from <android-sdk>/extras/google/google_play_services/libproject, but I included it in the unity package for convenience.

If you don't include an AndroidManifest.xml file in Assets/Plugins/Android/, Unity will autogenerate one for you when you build your project. When you build, Temp/StagingArea/AndroidManfiest-main.xml will be either the copy of what you but into Assets/Plugins/Android or the one unity generates for you, and Temp/StagingArea/AndroidManifest.xml will be the final manifest after Unity merges stuff from other library project manifests (such as google play services).

The Google Mobile Ads library requires the com.google.android.gms.ads.Activity class as well as INTERNET and ACCESS_NETWORK_STATE permissions that aren't part of the Unity auto-generated manifest, as well as the <meta-data name="unity.ForwardNativeEventsToDalvik> tag to be true. That is why the GoogleMobileAds.unitypackage ships with Assets/Plugins/Android/AndroidManifest.xml so that is the baseline manifest Unity builds with, and guarantees these activity/permission declarations will be in the final manifest.

Thanks,
Eric
solution_demo_Craig_Carlson.unitypackage

Craig Carlson

unread,
Jun 6, 2014, 3:20:07 PM6/6/14
to google-adm...@googlegroups.com
Hi Eric,

Apparently I wasn't paying enough attention when I made that .unitypackage because I did have the Assets/Plugins/ part, but that wasn't included when I chose "select dependencies". Regardless, I created a new project, imported both my package and your solution package, and after running it I'm still getting this error:

W/Ads     ( 5865): Received error HTTP response code: 400
W/Ads     (15099): There was a problem getting an ad response. ErrorCode: 0
W/Ads     (15099): Failed to load ad: 0

If you're able to run my code then the problem might be my testing device (Droid DNA). I'll try to get my hands on another device or maybe just an emulator.

Thank your help thus far.
-Craig

Eric Leichtenschlag

unread,
Jun 6, 2014, 4:55:19 PM6/6/14
to google-adm...@googlegroups.com
Yeah I would suggest trying a different device. I'm not sure if it's device or network related or possibly the Google mobile Ads SDK, but I'm pretty certain it's not an issue with the Unity plugin or your implementation. I've attached an apks for our hello world banner example. Both use the same ad unit. Try running this on your Droid DNA. I'm expecting you'll see the same result, in which case we can remove the unity plugin as a possible source of the issue.

Thanks,
Eric
example-gms-Banner.apk

Craig Carlson

unread,
Jun 6, 2014, 6:05:37 PM6/6/14
to google-adm...@googlegroups.com
Hi Eric. I ran that apk and I see "Hello World" but no ads. Logcat is showing me that same errors as before. I think it's safe to say that the problem lies with my testing device, which is strange because I'm able to see ads through other applications.

Craig Carlson

unread,
Jun 6, 2014, 6:30:47 PM6/6/14
to google-adm...@googlegroups.com
Hey Eric, I've found a solution to the problem. I have Adblock installed on my phone and apparently "allow ads" aka turning it off only allows certain ad platforms. I disabled wifi (Adblock only works for wifi) and found that I was able to see ads on your hello world program and my test program. Thank you for all the help.

Eric Leichtenschlag

unread,
Jun 6, 2014, 8:42:55 PM6/6/14
to google-adm...@googlegroups.com
Hey Craig,

I'd recommend trying a different device then. Not sure if it's the device, a custom mod, ad block or whatnot, but both those apps return ads on my Nexus 5.

Thanks,
Eric

Uchiha Sasuke

unread,
Jun 10, 2014, 1:41:25 PM6/10/14
to google-adm...@googlegroups.com
Hi Eric, I just started trying to implement admob a couple days ago with no luck. Only interstitial ads work but banners don't show. Your hello world app build works and displays banners tho, so its not my device problem. Also when I create a new empty project, and copy in the hello world assets and build it, the banners work, it just doesn't work with my script and in my existing project. I posted my code and problem here btw.

Thanks!
Chris
It is loading more messages.
0 new messages