Tuesday, June 26, 2012

java.lang.NoClassDefFoundError: com.google.ads.AdView

If you have Android Apps with admob, and you update admob API with current ADT (may be ADT-17 or later), may be your code can be compiled without error, but fail in run-time, caused by java.lang.NoClassDefFoundError: com.google.ads.AdView!

It seem to be problem in ADT with external jars. To solve it:

- Create a libs folder in your project.

- Copy AdMob jar, GoogleAdMobAdsSdk-6.0.1.jar, in the libs folder.

- Update Java Build Path by selecting "Add JARs..." (NOT "Add External JARs...") to add the jar in libs.

No comments: