Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google play services 5.0.77

From the 25th of june two unrelated apps that are using ads started to have this NPE

java.lang.NullPointerException
   at zo.a(SourceFile:172)
   at aeh.a(SourceFile:120)
   at afw.run(SourceFile:14)
   at afy.run(SourceFile:30)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
   at java.lang.Thread.run(Thread.java:856)

I think this is related to google play services update. Is anyone able to help me out on this issue?

Just to confirmed that the issue is related to play service I have managed to get this from crashlytics from a thread called AdWorker:

thread
   at java.lang.Object.wait(Object.java)
   at java.lang.Thread.parkFor(Thread.java:1231)
   at sun.misc.Unsafe.park(Unsafe.java:323)
   at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:813)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:973)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1282)
   at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:207)
   at zo.a(SourceFile:147)
   at zo.a(SourceFile:170)
   at aeh.a(SourceFile:120)
   at afw.run(SourceFile:14)
   at afy.run(SourceFile:30)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
   at java.lang.Thread.run(Thread.java:856)

it is not the right place... but there is no place at all where to report them

Number of exceptions it has double from 1 july, it is now almost 3 times what it was the 27th of june.

Issue on android google code project

The discussion is now in this thread on admob google Heading group

Last reply from google "We're aware of these crashes and are working on fixes. We hope to push out these fixes in the next week or two." (July 7th)

like image 966
Luigi Agosti Avatar asked Jun 27 '14 17:06

Luigi Agosti


People also ask

What is the current Google Play Services version?

Google Play Services 22.26.

Why does my phone keep telling me to update Google Play Services?

Google Play services is a background app that's integral to downloading software and updates from the Google Play Store. If you receive an error message when attempting to load an app or game, you may have to manually update Google Play services or clear the cache.

How do I fix Google Play Services not supported?

Go To Settings> Security > Device Administators> Disable Android Device manager. Now Go to Apps and Disable Google Play Services and Clear Its data, Clear Data of Play Store too. Reboot device andd Enable Google Play Services.


4 Answers

Found this solution by Mateusz Matela at https://groups.google.com/forum/#!topic/google-admob-ads-sdk/DkjtCx_Zvn8.

I have tried on a Motorola DEFY+ that crashed from this bug two out of three times. It seems to work even when the warnings assositated with this bug appears in the log. It even says "AdWorker thread thrown an exception". My ads even reappeard when continuing to use the app.

final UncaughtExceptionHandler defaultHandler = Thread.getDefaultUncaughtExceptionHandler();
Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {
        @Override
        public void uncaughtException(Thread thread, Throwable ex) {
            if (thread.getName().startsWith("AdWorker")) {
                Log.w("ADMOB", "AdWorker thread thrown an exception.", ex);
            } else if (defaultHandler != null) {
                defaultHandler.uncaughtException(thread, ex);
            } else {
                throw new RuntimeException("No default uncaught exception handler.", ex);
            }
        }
});
like image 182
MBanks Avatar answered Oct 11 '22 18:10

MBanks


Today, Google posts this : http://android-developers.blogspot.fr/2014/07/google-play-services-5.html

And now it works for me. Just try again to update the GooglePlayService in your mobile and update your ADT.

Edit :

Code to check GPS version :

// Check if GooglePlay Service is good;
            resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this.getActivity());
            if (resultCode != ConnectionResult.SUCCESS) {
                if (GooglePlayServicesUtil.isUserRecoverableError(resultCode)) {
                    GooglePlayServicesUtil.getErrorDialog(resultCode, this.getActivity(), 1).show();
                    rootView = inflater.inflate(R.layout.fragment_googleplayerror, container, false);
                    return rootView;
                } else {
                    Log.i(Tag, "This device is not supported.");
                    getActivity().finish();
                }
            }
like image 44
Cocorico Avatar answered Oct 11 '22 17:10

Cocorico


I got exactly same errors on different android versions after updating admob to google play services. I think it can't be solved on user side.

like image 2
ucdevs Avatar answered Oct 11 '22 17:10

ucdevs


It is related to Play services update, see sample crash log below. Since it crashes onCreate it might be happening when user click on an advert or a specific type of advert

USER_COMMENT=
ANDROID_VERSION=4.1.2
APP_VERSION_NAME=8.9
BRAND=samsung
PHONE_MODEL=GT-I9100
CUSTOM_DATA=
STACK_TRACE=java.lang.RuntimeException: Unable to start activity ComponentInfo{xxxxx/com.google.android.gms.ads.AdActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2110)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2135)
at android.app.ActivityThread.access$700(ActivityThread.java:140)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4921)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at acm.a(SourceFile:215)
at acz.onTransact(SourceFile:58)
at android.os.Binder.transact(Binder.java:326)
at com.google.android.gms.internal.ck$a$a.onCreate(Unknown Source)
at com.google.android.gms.ads.AdActivity.onCreate(Unknown Source)
at android.app.Activity.performCreate(Activity.java:5206)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2074)
... 11 more
java.lang.NullPointerException
at acm.a(SourceFile:215)
at acz.onTransact(SourceFile:58)
at android.os.Binder.transact(Binder.java:326)
at com.google.android.gms.internal.ck$a$a.onCreate(Unknown Source)
at com.google.android.gms.ads.AdActivity.onCreate(Unknown Source)
at android.app.Activity.performCreate(Activity.java:5206)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2074)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2135)
at android.app.ActivityThread.access$700(ActivityThread.java:140)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4921)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
at dalvik.system.NativeStart.main(Native Method)
like image 2
nLL Avatar answered Oct 11 '22 17:10

nLL