简体   繁体   English

如何修复AdMob导致我的Android应用崩溃?

[英]How do I fix AdMob crashing my Android app?

AdMob has been working in my Android app for a while now until recently when I tried to update. 直到最近我尝试更新时,AdMob一直在我的Android应用中工作了一段时间。 I tried to update the app itself but I saw that it kept crashing. 我尝试更新应用程序本身,但发现它一直崩溃。

I tried debugging what happened. 我尝试调试发生了什么。 The app seems to work once I removed the ads. 删除广告后,该应用似乎可以正常工作。 I've now published the app without any ads and it works fine. 我现在发布了没有任何广告的应用程序,并且运行良好。 Any reasons why it may have all of a sudden stopped working? 有什么原因可能导致它突然停止工作? I haven't changed any of the code before. 我之前没有更改任何代码。 The only code I changed were additional tips in my Relationship tips app. 我更改的唯一代码是“关系提示”应用程序中的其他提示。

确保在属性-> Java构建路径->订单和导出中选中了jar文件。

You didn't post error so I am just guessing, admob had a bug on android os 2.1+, and I had a admob crashing issue, I found a suggestion to not calling adview.destroy on OnDestroy because it causes crashing. 您没有发布错误,所以我只是在猜测,admob在android os 2.1+上有一个错误,并且我遇到了admob崩溃的问题,我发现建议不要在OnDestroy上调用adview.destroy,因为它会导致崩溃。

If you have adview.destroy() on your onDestroy override, just remark it and try. 如果onDestroy覆盖上有adview.destroy(),只需对其进行标记并尝试。

  @Override
  protected void onDestroy() {
    super.onDestroy();

    // bug at sdk, no need to call
    //adView.destroy();
  }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM