从 6 月 25 日起,两个使用广告的不相关应用开始出现此 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)
我认为这与 google play 服务更新有关。有人能帮我解决这个问题吗?
为了确认该问题与播放服务有关,我已设法从名为 AdWorker 的线程的 crashlytics 中获得此问题:
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)
这不是正确的地方...但是根本没有地方可以报告它们
它的异常数量从 7 月 1 日起翻了一番,现在几乎是 6 月 27 日的 3 倍。
Issue on android google code project
讨论现在在 admob google Heading group 上的这个帖子中进行。
来自谷歌的最后回复“我们知道这些崩溃并正在努力修复。我们希望在接下来的一两周内推出这些修复程序。” (7月7日)
最佳答案
Mateusz Matela 在 https://groups.google.com/forum/#!topic/google-admob-ads-sdk/DkjtCx_Zvn8 找到了这个解决方案.
我尝试过摩托罗拉 DEFY+,三分之二的时候该错误导致崩溃。即使与此错误相关的警告出现在日志中,它似乎也能正常工作。它甚至说“AdWorker 线程抛出了异常”。继续使用该应用时,我的广告甚至会重新出现。
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);
}
}
});
关于android - 谷歌播放服务 5.0.77,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24457689/