过去一周,我开始收到很多与AdMob,AdView创建相关的ANR报告。 我的代码中没有改变任何内容。
我在我的Activity onCreate()方法中创建它,如下所示:
this.adView = new AdView(this, AdSize.SMART_BANNER, "axxxxxxxxxxxxxx");
这是我正在获得的ANR堆栈
at dalvik.system.DexFile.openDexFile(Native Method)
at dalvik.system.DexFile.<init>(DexFile.java:93)
at dalvik.system.DexFile.loadDex(DexFile.java:133)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:261)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:229)
at dalvik.system.DexPathList.<init>(DexPathList.java:96)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:52)
at dalvik.system.DexClassLoader.<init>(DexClassLoader.java:57)
at com.google.ads.ag.b(SourceFile:95)
at com.google.ads.ag.a(SourceFile:69)
at com.google.ads.bp.<init>(SourceFile:158)
at com.google.ads.a.w.<init>(SourceFile:266)
at com.google.ads.AdView.a(SourceFile:508)
at com.google.ads.AdView.<init>(SourceFile:94)
我尝试在后台线程中创建AdView,但它似乎仅在UI线程中创建时才有效...