Hello,
I have a problem with the migration from 6.4.1 (.jar) to "google-play-services_lib" + admob.
I use only the most basic banner (exactly the tutorial Banner I).
With admob 6.4.1, I have no problem.
With "google-play-services_lib" + admob, I have this strange issue :
All the ads are correctly received (see logcat, + details).
But the first ad is never shown. Second ad, and all afterward, always appear correctly.
I configured the ads to be changed every 60sec, so basically : during the first 60sec, I don't see anything. After 60s, I start to see ads.
=> It looks like the second refresh make the AdView appeared / focused ?.
More details :
All Android SDK and packages are updated to the latest version, I use ndk-r9c, a phone device (nexus5 + normal rom android 4.4).
and target-api=19. I dont use the addTestDevice.
My application is 99% native, but with a thin java layer. I basically use a game library based on egl.
The java parts consists in an activity, with an "AbsoluteLayout" where are added (within the onCreate) two views : a SurfaceView for the native egl stuff, and the AdView.
What I think to be relevant, and what I have done for debugging :
- As I said, with admob_6.4.1 (and without Google-play-service), I have no problem. I mean that I see all the ads, from the beginning of the app.
I have only the modification to migrate from admob_6.4.1 to Google-Play-Services+admob.
- The logcat show that the ad is always correctly received (+ an error of GooglePlayServicesUtil).
- If I changed the AbsoluteView by a RelativeLayout (and permute also the two views, because SurfaceView is fullscree) I see the ads from the beginning (of course this is not the layout exected !)
- If I remove the SurfaceView, I see the correctly ads (but not the game of course)
- If I changed the SurfaceView by a TextView (with lot of text inside). I see correctly the ads over the TextView.
- I tried to use "bringChidToFront" on the AdView, but it does not help.
- I tried to use setZOrderMediaOverlay and setZOrderOnTop on the SurfaceView, but it does not help.
- Something strange. During the first 60s, I see no ad, but If start pressing "home" button -> I see the ad during a fraction of second before the app goes to background.
If I restore to foreground, I see the ads. (I have the new pause/resume/destroy calls, as required).
- If I use addTestDevice + the correct device_id, I don't see anything. But If I press home+restore, I see the true ad (not the test ad).
- See also the "GooglePlayServicesUtil" message in the Log. I think the lib is correctly installed. I copied the whole folder, to my own place, and referenced it within the project.properties.
- I added some debug message with the "AdListener" (banner II tutorial), I only see "onAdLoaded". No error message.
So, do you have an idea ? What has been changed ? What could I do ?
Thanks,
Sylvain
logcat with : adb shell "setprop log.tag.Ads VERBOSE; logcat Ads:* *:S"
First Ad, but does not appear :
I/Ads (16333): Use AdRequest.Builder.addTestDevice("0A8EF8E127F7072E941E6D7882BF0E8E") to get test ads on this device.
I/Ads (16333): Starting ad request.
D/Ads (16333): Enabling hardware acceleration on an AdView.
D/Ads (16333): AdLoaderBackgroundTask started.
E/GooglePlayServicesUtil(16333): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
D/Ads (16333): Fetching ad response from remote ad request service.
E/GooglePlayServicesUtil(16333): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
E/GooglePlayServicesUtil(16333): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
D/Ads (24313): Binding to the ad request service.
D/Ads (24313): Starting ad request from service.
D/Ads (24313): Enabling hardware acceleration on an overlay.
D/Ads (24313): Getting the ad request URL.
D/Ads (16333): Received ad response.
D/Ads (16333): WebView finished loading.
I/Ads (16333): Scheduling ad refresh 60000 milliseconds from now.
D/Ads (16333): Pinging Impression URLs.
I/Ads (16333): Ad finished loading.
The second does appear :
I/Ads (16333): Starting ad request.
D/Ads (16333): Enabling hardware acceleration on an AdView.
D/Ads (16333): AdLoaderBackgroundTask started.
E/GooglePlayServicesUtil(16333): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
D/Ads (16333): Fetching ad response from remote ad request service.
E/GooglePlayServicesUtil(16333): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
E/GooglePlayServicesUtil(16333): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
D/Ads (24313): Binding to the ad request service.
D/Ads (24313): Starting ad request from service.
D/Ads (24313): Enabling hardware acceleration on an overlay.
D/Ads (24313): Getting the ad request URL.
D/Ads (16333): Received ad response.
D/Ads (16333): WebView finished loading.
I/Ads (16333): Scheduling ad refresh 60000 milliseconds from now.
D/Ads (16333): Pinging Impression URLs.
I/Ads (16333): Ad finished loading.