Integrate AdMob to my android studio project,error:"GooglePlayServicesUtil: Cannot find Google Play"

1,022 views
Skip to first unread message

王文景

unread,
Jun 3, 2016, 4:48:35 AM6/3/16
to Google Mobile Ads SDK Developers
I follow the quick start guide to integrate AdMob to a fresh new android studio project. I can't see the test ads and got error:"GooglePlayServicesUtil: Cannot find Google Play services package name." when I run this project on my device.Detail error as follow:
06-03 16:40:23.571 22409-22836/com.google.android.gms.example.bannerexample W/GooglePlayServicesUtil: Cannot find Google Play services package name.
                                                                                                      android.content.pm.PackageManager$NameNotFoundException: com.google.android.gms
                                                                                                          at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:137)
                                                                                                          at com.google.android.gms.internal.zzpv.getPackageInfo(Unknown Source)
                                                                                                          at com.google.android.gms.common.zze.zzap(Unknown Source)
                                                                                                          at com.google.android.gms.common.zze.zzao(Unknown Source)
                                                                                                          at com.google.android.gms.common.zze.zzaj(Unknown Source)
                                                                                                          at com.google.android.gms.common.zze.isGooglePlayServicesAvailable(Unknown Source)
                                                                                                          at com.google.android.gms.common.zzc.isGooglePlayServicesAvailable(Unknown Source)
                                                                                                          at com.google.android.gms.measurement.internal.zzad.zzGC(Unknown Source)
                                                                                                          at com.google.android.gms.measurement.internal.zzad.zzmC(Unknown Source)
                                                                                                          at com.google.android.gms.measurement.internal.zzad.zzi(Unknown Source)
                                                                                                          at com.google.android.gms.measurement.internal.zzad.zzGx(Unknown Source)
                                                                                                          at com.google.android.gms.measurement.internal.zzac.zzGx(Unknown Source)
                                                                                                          at com.google.android.gms.measurement.internal.zzx.start(Unknown Source)
                                                                                                          at com.google.android.gms.measurement.internal.zzx$1.run(Unknown Source)
                                                                                                          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
                                                                                                          at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                                                                                                          at com.google.android.gms.measurement.internal.zzw$zzd.run(Unknown Source)
06-03 16:40:23.572 22409-22836/com.google.android.gms.example.bannerexample W/GooglePlayServicesUtil: Google Play services is missing.

When I run the downloaded sample code, the error still exists.

Does anyone has any idea to solve this issue? or can anyone give me some tint about this error?


Best,

Wang Wenjing

王文景

unread,
Jun 3, 2016, 7:12:30 AM6/3/16
to Google Mobile Ads SDK Developers
Does AdMob need Google Play services support in product? I am a Chinese, and most of our android devices does not install the Google play service. So how can I display ads from AdMob in China market?

在 2016年6月3日星期五 UTC+8下午4:48:35,王文景写道:

Vu Chau (Mobile Ads SDK Team)

unread,
Jun 3, 2016, 12:01:15 PM6/3/16
to Google Mobile Ads SDK Developers
Hi Wenjing,

The SDK can certainly run on devices that do not have a local Google Play services version installed.  In that case, the SDK will use the version that it is compiled against when you are building the APK.

Could you let us know more details, including the following?
  • Do you have Google Play services downloaded with your Android SDK?  You can check via Android Studio's SDK Manager to confirm this.  If Google Play services is downloaded, what is the version number?
  • Which of our samples were you using?  The latest example is using Firebase (com.google.firebase:firebase-ads:9.0.0) versus Google Play services (com.google.android.gms:play-services-ads:9.0.0).  Check out the Firebase dependency option and let us know if that helps.
Vu Chau
Mobile Ads SDK Team

王文景

unread,
Jun 7, 2016, 12:01:05 AM6/7/16
to google-adm...@googlegroups.com
Dear  Chau,
   1. I installed the Google Play services "Google Play services,rev 30".
   2. I follow the sample and use "compile 'com.google.android.gms:play-services:9.0.1'"

When I install the Google Play service and Google Play store, Ads will show. If I uninstall either of them, the Ads don't show.

--

---
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/dZ9wQDoXra0/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.

王文景

unread,
Jun 7, 2016, 12:04:30 AM6/7/16
to google-adm...@googlegroups.com
The sample dependency is :dependencies {
    compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.google.firebase:firebase-ads:9.0.0'
}

apply plugin: 'com.google.gms.google-services'

Vu Chau (Mobile Ads SDK Team)

unread,
Jun 7, 2016, 4:24:58 PM6/7/16
to Google Mobile Ads SDK Developers
Hi Wenjing,

The SDK should still be able to serve ads on devices that do not have a local copy of Google Play services.

Would you confirm if adding the following ProGuard rule rectify the issue?

-keep public @com.google.android.gms.common.util.DynamiteApi class * { *; }

There was a known bug in the 9.0.0 release where ProGuard would strip away portion of the SDK that contains Google Play services.

Vu Chau
Mobile Ads SDK Team

On Tuesday, June 7, 2016 at 12:04:30 AM UTC-4, 王文景 wrote:
The sample dependency is :dependencies {
    compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.google.firebase:firebase-ads:9.0.0'
}

apply plugin: 'com.google.gms.google-services'
2016-06-07 12:00 GMT+08:00 王文景 <wangwenj...@gmail.com>:
Dear  Chau,
   1. I installed the Google Play services "Google Play services,rev 30".
   2. I follow the sample and use "compile 'com.google.android.gms:play-services:9.0.1'"

When I install the Google Play service and Google Play store, Ads will show. If I uninstall either of them, the Ads don't show.
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.

王文景

unread,
Jun 7, 2016, 11:26:40 PM6/7/16
to google-adm...@googlegroups.com
Hi Chau,
   I add the following sentence to my "proguard-rules.pro" . 
-keep public @com.google.android.gms.common.util.DynamiteApi class * { *; }
Then I uninstall the Google Play store and run the sample code. I got errors as follows: it tell me it can't find the "Google Play store" rather than "can't find package name". It's an progress but still not work as you said. Can you help me find further question?
06-08 11:20:26.547 6267-6267/com.google.android.gms.example.bannerexample W/e.bannerexample: type=1400 audit(0.0:186711): avc: denied { read } for name="mem" dev="debugfs" ino=600558 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:debugfs:s0 tclass=file permissive=0
06-08 11:20:26.547 6267-6267/com.google.android.gms.example.bannerexample W/e.bannerexample: type=1400 audit(0.0:186712): avc: denied { read } for name="mem" dev="debugfs" ino=600558 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:debugfs:s0 tclass=file permissive=0
06-08 11:20:26.567 6267-6721/com.google.android.gms.example.bannerexample W/GooglePlayServicesUtil: Google Play Store is neither installed nor updating.
06-08 11:20:26.567 6267-6721/com.google.android.gms.example.bannerexample W/Ads: Failed to connect to remote ad request service.
06-08 11:20:26.567 6267-6721/com.google.android.gms.example.bannerexample W/Ads: Could not start the ad request service.
06-08 11:20:26.597 6267-6267/com.google.android.gms.example.bannerexample W/Ads: Failed to load ad: 0


Best,

Wang wenjing

2016-06-08 4:24 GMT+08:00 'Vu Chau (Mobile Ads SDK Team)' via Google Mobile Ads SDK Developers <google-adm...@googlegroups.com>:
Hi Wenjing,

The SDK should still be able to serve ads on devices that do not have a local copy of Google Play services.

Would you confirm if adding the following ProGuard rule rectify the issue?

-keep public @com.google.android.gms.common.util.DynamiteApi class * { *; }

There was a known bug in the 9.0.0 release where ProGuard would strip away portion of the SDK that contains Google Play services.

Vu Chau
Mobile Ads SDK Team

On Tuesday, June 7, 2016 at 12:04:30 AM UTC-4, 王文景 wrote:
The sample dependency is :dependencies {
    compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.google.firebase:firebase-ads:9.0.0'
}

apply plugin: 'com.google.gms.google-services'
2016-06-07 12:00 GMT+08:00 王文景 <wangwenj...@gmail.com>:
Dear  Chau,
   1. I installed the Google Play services "Google Play services,rev 30".
   2. I follow the sample and use "compile 'com.google.android.gms:play-services:9.0.1'"

When I install the Google Play service and Google Play store, Ads will show. If I uninstall either of them, the Ads don't show.
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/dZ9wQDoXra0/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.

David Zhu

unread,
Jun 8, 2016, 3:53:03 AM6/8/16
to Google Mobile Ads SDK Developers
I have the same problem with my device Mi 4C


在 2016年6月3日星期五 UTC+8下午4:48:35,王文景写道:
I follow the quick start guide to integrate AdMob to a fresh new android studio project. I can't see the test ads and got error:"GooglePlayServicesUtil: Cannot find Google Play services package name." when I run this project on my device.Detail error as follow:

Vu Chau (Mobile Ads SDK Team)

unread,
Jun 8, 2016, 2:13:21 PM6/8/16
to Google Mobile Ads SDK Developers
Hi all,

Thanks again for the additional test.  I have spoken with the rest of the team and we would like to investigate this issue on our end.  Once there is news, one of us will reach out again to let you know of an update.

Vu Chau
Mobile Ads SDK Team

王文景

unread,
Jun 11, 2016, 10:17:03 PM6/11/16
to google-adm...@googlegroups.com
Hi Chau,
    An update: My device is Mi 4.  Could you please let me know when your team got further information for this issue by email. Thanks in advance.

--

王文景

unread,
Jun 12, 2016, 1:21:00 AM6/12/16
to google-adm...@googlegroups.com
Hi Chau,
    I changed the testing device to Nokia Tablet. It didn't install the google play service and google play store. error as follow:
06-12 13:16:50.479 20804-21045/com.google.android.gms.example.bannerexample W/GooglePlayServicesUtil: Cannot find Google Play services package name.
                                                                                                      android.content.pm.PackageManager$NameNotFoundException: com.google.android.gms
                                                                                                          at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:114)
                                                                                                          at com.google.android.gms.internal.zzpv.getPackageInfo(Unknown Source)
                                                                                                          at com.google.android.gms.common.zze.zzap(Unknown Source)
                                                                                                          at com.google.android.gms.common.zze.zzao(Unknown Source)
                                                                                                          at com.google.android.gms.common.zze.zzaj(Unknown Source)
                                                                                                          at com.google.android.gms.common.zze.isGooglePlayServicesAvailable(Unknown Source)
                                                                                                          at com.google.android.gms.common.zzc.isGooglePlayServicesAvailable(Unknown Source)
                                                                                                          at com.google.android.gms.measurement.internal.zzad.zzGC(Unknown Source)
                                                                                                          at com.google.android.gms.measurement.internal.zzad.zzmC(Unknown Source)
                                                                                                          at com.google.android.gms.measurement.internal.zzad.zzi(Unknown Source)
                                                                                                          at com.google.android.gms.measurement.internal.zzad.zzGx(Unknown Source)
                                                                                                          at com.google.android.gms.measurement.internal.zzac.zzGx(Unknown Source)
                                                                                                          at com.google.android.gms.measurement.internal.zzx.start(Unknown Source)
                                                                                                          at com.google.android.gms.measurement.internal.zzx$1.run(Unknown Source)
                                                                                                          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
                                                                                                          at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                                                                                                          at com.google.android.gms.measurement.internal.zzw$zzd.run(Unknown Source)
06-12 13:16:50.479 20804-21045/com.google.android.gms.example.bannerexample W/GooglePlayServicesUtil: Google Play services is missing.
06-12 13:16:50.660 20804-20804/com.google.android.gms.example.bannerexample W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
06-12 13:16:50.767 20804-20804/com.google.android.gms.example.bannerexample W/GooglePlayServicesUtil: Google Play services is missing.
06-12 13:16:50.820 20804-20804/com.google.android.gms.example.bannerexample W/GooglePlayServicesUtil: Google Play services is missing.


Vu Chau (Mobile Ads SDK Team)

unread,
Jun 13, 2016, 12:33:32 PM6/13/16
to Google Mobile Ads SDK Developers
Hi Wenjing,

The team is working on it.  We will let you know once we have an update!

Vu Chau
Mobile Ads SDK Team

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.

lovear...@gmail.com

unread,
Jun 17, 2016, 6:09:21 AM6/17/16
to Google Mobile Ads SDK Developers
Have you team fixed the "Cannot find Google Play services package name." problem?
To post to this group, send email to google-adm...@googlegroups.com.

Vu Chau (Mobile Ads SDK Team)

unread,
Jun 17, 2016, 4:15:52 PM6/17/16
to Google Mobile Ads SDK Developers
Hi there,

The team is still investigating the issue. I will share an update once I have heard back from them.

Thanks,

Vu Chau
Mobile Ads SDK Team

Wang Xiaofang

unread,
Jul 1, 2016, 12:01:32 AM7/1/16
to Google Mobile Ads SDK Developers

Hi, I'm using firebase and I see the same error
57:com.salesforce.chatterbox.lib.providers.ItemsContentProvider:onCreate:ItemsContentProvider.onCreate()
06-30 23:37:57.328 W/GooglePlayServicesUtil( 1904): Cannot find Google Play services package name.
06-30 23:37:57.328 W/GooglePlayServicesUtil( 1904): android.content.pm.PackageManager$NameNotFoundException: com.google.android.gms
06-30 23:37:57.328 W/GooglePlayServicesUtil( 1904): 	at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:82)
06-30 23:37:57.328 W/GooglePlayServicesUtil( 1904): 	at com.google.android.gms.internal.zzpv.getPackageInfo(Unknown Source)
06-30 23:37:57.328 W/GooglePlayServicesUtil( 1904): 	at com.google.android.gms.common.zze.zzap(Unknown Source)
06-30 23:37:57.328 W/GooglePlayServicesUtil( 1904): 	at com.google.android.gms.common.zze.zzao(Unknown Source)
06-30 23:37:57.328 W/GooglePlayServicesUtil( 1904): 	at com.google.android.gms.common.zze.zzaj(Unknown Source)
06-30 23:37:57.328 W/GooglePlayServicesUtil( 1904): 	at com.google.android.gms.common.zze.isGooglePlayServicesAvailable(Unknown Source)
06-30 23:37:57.328 W/GooglePlayServicesUtil( 1904): 	at com.google.android.gms.common.zzc.isGooglePlayServicesAvailable(Unknown Source)
06-30 23:37:57.328 W/GooglePlayServicesUtil( 1904): 	at com.google.android.gms.measurement.internal.zzad.zzGC(Unknown Source)
06-30 23:37:57.328 W/GooglePlayServicesUtil( 1904): 	at com.google.android.gms.measurement.internal.zzad.zzmC(Unknown Source)
06-30 23:37:57.328 W/GooglePlayServicesUtil( 1904): 	at com.google.android.gms.measurement.internal.zzad.zzi(Unknown Source)
06-30 23:37:57.328 W/GooglePlayServicesUtil( 1904): 	at com.google.android.gms.measurement.internal.zzad.zzGx(Unknown Source)
06-30 23:37:57.328 W/GooglePlayServicesUtil( 1904): 	at com.google.android.gms.measurement.internal.zzac.zzGx(Unknown Source)
06-30 23:37:57.328 W/GooglePlayServicesUtil( 1904): 	at com.google.android.gms.measurement.internal.zzx.start(Unknown Source)
06-30 23:37:57.328 W/GooglePlayServicesUtil( 1904): 	at com.google.android.gms.measurement.internal.zzx$1.run(Unknown Source)
06-30 23:37:57.328 W/GooglePlayServicesUtil( 1904): 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
06-30 23:37:57.328 W/GooglePlayServicesUtil( 1904): 	at java.util.concurrent.FutureTask.run(FutureTask.java:237)
06-30 23:37:57.328 W/GooglePlayServicesUtil( 1904): 	at com.google.android.gms.measurement.internal.zzw$zzd.run(Unknown Source) 
06-30 23:37:57.328 W/GooglePlayServicesUtil( 1904): Google Play services is missing. 

Could you please also take a look at it thanks!!!

Vu Chau (Mobile Ads SDK Team)

unread,
Jul 1, 2016, 11:45:37 AM7/1/16
to Google Mobile Ads SDK Developers
Hi Xiaofang,

Thanks.  We are looking into this.

Vu Chau
Mobile Ads SDK Team

Aleksey Gureev

unread,
Jul 1, 2016, 1:49:05 PM7/1/16
to Google Mobile Ads SDK Developers
Same here. And if I add "compile 'com.google.android.gms:play-services:9.2.0'" to dependencies, the app fails to build with "The number of method references in a .dex file cannot exceed 64K."

Please advise.

Cheers,
- Aleks

Vu Chau (Mobile Ads SDK Team)

unread,
Jul 1, 2016, 3:24:55 PM7/1/16
to Google Mobile Ads SDK Developers
Aleks,

You'd need to enable multidex for your build.  

Vu Chau
Mobile Ads SDK Team

Vu Chau (Mobile Ads SDK Team)

unread,
Jul 14, 2016, 9:18:54 PM7/14/16
to Google Mobile Ads SDK Developers
Hi all,

Just an update that we got a fix slated to resolve this issue.  I will get back with more details.

Vu Chau
Mobile Ads SDK Team

shuai jiao

unread,
Jul 19, 2016, 3:29:05 AM7/19/16
to Google Mobile Ads SDK Developers
 Is there any new release? 

Sam J

unread,
Jul 26, 2016, 2:17:32 PM7/26/16
to Google Mobile Ads SDK Developers
Hello,
I am experiencing the same problem reported in this thread. I just enabled Ads in a new App I made sure all the settings are correct.
The Apps runs fine but never showed Ads until I see in logcat the following:
Please we need a fix soon.

Cannot find Google Play services package name.
                                                                                                android.content.pm.PackageManager$NameNotFoundException: com.google.android.gms
                                                                                                    at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:114)

thank you in advance,

Vu Chau (Mobile Ads SDK Team)

unread,
Jul 26, 2016, 2:27:11 PM7/26/16
to Google Mobile Ads SDK Developers
Hi Sam,

The fix is included in Google Play services 9.4.  Once it is 100% live (release notes), make sure to recompile your app against v9.4 and let us know if the issue persists.

Vu Chau
Mobile Ads SDK Team

Reply all
Reply to author
Forward
0 new messages