How do I fix AdMob crashing my Android app?

非 Y 不嫁゛ 提交于 2019-12-13 05:52:28

问题


AdMob has been working in my Android app for a while now until recently when I tried to update. 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.


回答1:


Make sure your jar files are checked in Properties --> Java Build Path --> Order and Export.




回答2:


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.

If you have adview.destroy() on your onDestroy override, just remark it and try.

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

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


来源:https://stackoverflow.com/questions/10155901/how-do-i-fix-admob-crashing-my-android-app

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!