Android AdView:致命信号 4 (SIGILL),代码 2,错误地址 0xb6fc346e in tid 2826 (AdWorker #3)

Android AdView: Fatal signal 4 (SIGILL), code 2, fault addr 0xb6fc346e in tid 2826 (AdWorker #3)

这个错误 libc : Fatal signal 4 (SIGILL), code 2, fault addr 0xb6fc346e in tid 2826 (AdWorker #3) 碰巧弹出,我不知道如何修复它,因为没有堆栈跟踪。我正在使用 Genymotion 模拟器,它只出现在 Lollipop 上。

它以某种方式连接到我的 Adview,因为当我评论 loadAd() 时,错误消失了。

avHomeAd = (AdView) this.findViewById(R.id.avHomeAd);
AdRequest adRequest = new AdRequest.Builder().build();
//avHomeAd.loadAd(adRequest); <--commenting this out fixes it, but then I get no ads :(

如何修复?

答案就在权限中! 我注释掉了 ACCESS_NETWORK_STATE 权限,它不再显示了。 Google AdMob 文档说无论如何它都是可选的。

<uses-permission android:name="android.permission.INTERNET" />

<!--This crashes app on Genymotion lollipop emulator when combined with AdView.
It is optional for adView says google docs, ignore the error msg thrown in logcat
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>-->

缺点是有时广告不会出现在模拟器中,但它会出现在我的真实设备 (kitkat) 上。我仍然不知道包含该权限是否会使真正的 Lollipop 设备崩溃,因为我手头没有!也许有人可以插话。

您的应用现在可能会在下面抛出此错误(不会使应用崩溃),这是我首先添加权限的唯一原因!但由于它是可选的并且会导致棒棒糖模拟器崩溃,所以我将忽略它。

E/GAV4﹕ Thread[GAThread,5,main]: Error on GAThread: java.lang.SecurityException: ConnectivityService: Neither user 10059 nor current process has android.permission.ACCESS_NETWORK_STATE.