简体   繁体   中英

Google AdMob java.lang.NoClassDefFoundError: com.google.android.gms.ads.AdView

Google Play Services requires an update to the newest version by August 1st, yet it errors out over and over, even with the sample apps they provide. Set it up about 100 different times so far following their instructions exactly, and the same thing. Over and over.... even with their sample apps!

Could not find class 'com.google.android.gms.ads.AdView', referenced from method com.google.android.gms.samples.ads.BannerCodeActivity.onCreate": "java.lang.NoClassDefFoundError: com.google.android.gms.ads.AdView

Spent 3 days on this already, and no progress. Hoping it's their bug and they fix it (like the google play game services demos a few weeks ago were only half updated to actually compile with Google Play services )

But if anyone uses Google Play Services with the latest version and has seen the problem... let me know. Seems to be a link error, but I've played around it every way I can

I had the same problem and tried almost every possible solution in the stackoverflow and almost whole internet but couldn't find the solution anywhere. But than somehow i realized that my project has some warnings that say "duplicate android support library on the projects". The messages say that the support libraries in my project and in a library project that i use inside my project has different versions of support libraries.

So i tried to solve this problem as deleting the support library in my own project and voila! The "different versions of android support library" and "NoClassDefFoundError com.google.android.gms.ads.AdView" have gone! So my advice is to check the console and the android logs if there happens to be any warnings or errors in the project.

The goolge_play_services-lib project must be included to your project only by the andorid settings inside properties. You mustn't add any jars externally. Also be sure to use the latest version of the google play services lib. I hope this will help you because i just worked nearly 2 days on this issue to solve,

regards.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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