AdMob just released v6.4.1 of the Android SDK which should address the ANR issue.
Android: ANR when creating AdView
Question
For the past week I started getting a lot of ANR reports related to AdMob, AdView creation. I didn't change anything in my code though.
I'm creating it in my Activity onCreate() method like this:
this.adView = new AdView(this, AdSize.SMART_BANNER, "axxxxxxxxxxxxxx");
Here's the ANR stack I'm getting
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)
I tried to create the AdView in a background thread but it seems to work only if created in the UI thread...
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow