Could not find class 'com.google.android.gms.ads.AdView'...

3,345 views
Skip to first unread message

Bolero

unread,
Jul 4, 2014, 10:58:59 AM7/4/14
to google-adm...@googlegroups.com
Hi, 

My application was used the Admob SDK 6.4.1.  It was working well, 

Now I try to upgrade new Admob SDK with google play services. 
I added the 'google-play-servcies' library at Library tap.

I red all document and build my application without any error. 

But When I run it on the phone, it occur below error. 


-------------------
07-04 23:39:25.236: D/dalvikvm(17685): VFY: replacing opcode 0x1f at 0x0067
07-04 23:39:25.236: E/dalvikvm(17685): Could not find class 'com.google.android.gms.ads.AdView', referenced from method com.bolero.skydrivebrowser.AdManager.requestNextAd
07-04 23:39:25.236: W/dalvikvm(17685): VFY: unable to resolve check-cast 1364 (Lcom/google/android/gms/ads/AdView;) in Lcom/bolero/skydrivebrowser/AdManager;
07-04 23:39:25.236: D/dalvikvm(17685): VFY: replacing opcode 0x1f at 0x00af
07-04 23:39:25.241: W/dalvikvm(17685): Unable to resolve superclass of Lcom/bolero/skydrivebrowser/AdManager$3; (1360)
07-04 23:39:25.241: W/dalvikvm(17685): Link of class 'Lcom/bolero/skydrivebrowser/AdManager$3;' failed
07-04 23:39:25.241: D/dalvikvm(17685): DexOpt: unable to opt direct call 0x1c47 at 0x1f in Lcom/bolero/skydrivebrowser/AdManager;.<init>
07-04 23:39:25.241: D/dalvikvm(17685): DexOpt: unable to opt direct call 0x2338 at 0x41 in Lcom/bolero/skydrivebrowser/AdManager;.addAd
07-04 23:39:25.241: I/dalvikvm(17685): DexOpt: unable to optimize static field ref 0x1032 at 0x46 in Lcom/bolero/skydrivebrowser/AdManager;.addAd
07-04 23:39:25.241: D/dalvikvm(17685): DexOpt: unable to opt direct call 0x2336 at 0x67 in Lcom/bolero/skydrivebrowser/AdManager;.addAd
07-04 23:39:25.241: D/AndroidRuntime(17685): Shutting down VM
07-04 23:39:25.241: W/dalvikvm(17685): threadid=1: thread exiting with uncaught exception (group=0x421c7700)
07-04 23:39:25.241: E/AndroidRuntime(17685): FATAL EXCEPTION: main
07-04 23:39:25.241: E/AndroidRuntime(17685): java.lang.NoClassDefFoundError: com.bolero.skydrivebrowser.AdManager$3
07-04 23:39:25.241: E/AndroidRuntime(17685): at com.bolero.skydrivebrowser.AdManager.<init>(AdManager.java:707)
07-04 23:39:25.241: E/AndroidRuntime(17685): at com.bolero.skydrivebrowser.MainActivity.onCreate(MainActivity.java:391)
07-04 23:39:25.241: E/AndroidRuntime(17685): at android.app.Activity.performCreate(Activity.java:5372)
07-04 23:39:25.241: E/AndroidRuntime(17685): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104)
07-04 23:39:25.241: E/AndroidRuntime(17685): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2270)
07-04 23:39:25.241: E/AndroidRuntime(17685): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2362)
07-04 23:39:25.241: E/AndroidRuntime(17685): at android.app.ActivityThread.access$700(ActivityThread.java:168)
07-04 23:39:25.241: E/AndroidRuntime(17685): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1329)
07-04 23:39:25.241: E/AndroidRuntime(17685): at android.os.Handler.dispatchMessage(Handler.java:99)
07-04 23:39:25.241: E/AndroidRuntime(17685): at android.os.Looper.loop(Looper.java:137)
07-04 23:39:25.241: E/AndroidRuntime(17685): at android.app.ActivityThread.main(ActivityThread.java:5493)
07-04 23:39:25.241: E/AndroidRuntime(17685): at java.lang.reflect.Method.invokeNative(Native Method)
07-04 23:39:25.241: E/AndroidRuntime(17685): at java.lang.reflect.Method.invoke(Method.java:525)
07-04 23:39:25.241: E/AndroidRuntime(17685): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1209)
07-04 23:39:25.241: E/AndroidRuntime(17685): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1025)
07-04 23:39:25.241: E/AndroidRuntime(17685): at dalvik.system.NativeStart.main(Native Method)
--------------------------------------

How can I solve this problem? 

Thanks, 
Bolero.

Mahi Saini

unread,
Jul 8, 2014, 6:08:58 AM7/8/14
to google-adm...@googlegroups.com
i also face same problem ..please help

Eric Leichtenschlag

unread,
Jul 9, 2014, 8:19:17 PM7/9/14
to google-adm...@googlegroups.com
I was facing the same problem when I dropped in Google Play services 5.0. Changing my project to compile against Java 1.7 resolved the issue for me. Can you confirm if this solves your problem as well?

Thanks,
Eric

Bolero

unread,
Jul 11, 2014, 9:06:27 AM7/11/14
to google-adm...@googlegroups.com
I solved this problem by re-install Eclipse and not update ADT. 

it maybe is a bug of new ADT  23.0.2.1259578. 

Bolero.

2014년 7월 10일 목요일 오전 9시 19분 17초 UTC+9, Eric Leichtenschlag 님의 말:

Eric Leichtenschlag

unread,
Jul 11, 2014, 1:11:58 PM7/11/14
to google-adm...@googlegroups.com
Hmm, I have ADT 23.0.2 but I don't crash when building against Java 1.7. I'm using Eclipse 4.3 but I don't think that's related.

Eric Carman

unread,
Jul 12, 2014, 6:57:30 PM7/12/14
to google-adm...@googlegroups.com
I've been fighting with this today as well. The last thing I tried was to install the build tools (via Android SDK Manager) that matched my target (19). Apparently I've been building with 18.0.1.

Today I was switching the app from the old adMob to the new Google Play apps version. It would seem that the old one is unaffected by the build tools. Now, it is also possible that a combination of things I did eventually got it to work, but I was trying to isolate the steps.

Summary: 

Java 1.6
ADT  23.0.2.1259578
Andriod SDK Bild-tools: 19.1

And I can see ads.

Hope this helps.

- Eric W. (different than the earlier Eric)

陳佑安

unread,
Jul 19, 2014, 10:50:38 AM7/19/14
to google-adm...@googlegroups.com
I'm facing the same problem now... I've already use eclipse 4.3 and java 1.7 but it's still not work. If anyone has other solution please tell me, thanks a lot.

The following is my build environment:

1. Eclipse Kepler Service Release 2
2. jdk 1.7.0_17
3. ADT 23.0.2.1259578
4. Android SDK Tools 23.0.2
5. Android SDK Platform-tools 20
6. Google Play Services revision 18 (5077000)

Eric Carman於 2014年7月13日星期日UTC+8上午6時57分30秒寫道:

RBM

unread,
Jul 28, 2014, 5:19:26 PM7/28/14
to google-adm...@googlegroups.com
Hi,

I am having the same problem. I have followed all instructions, read through all threads on StackOverflow on this, trying every possible solution and still it shows java.lang.NoClassDefFoundError: com.google.android.gms.common.GooglePlayServicesUtil.

The only thing I haven't done is reinstalling Eclipse. Can anyone confirm if this is a bug?

Eric Leichtenschlag

unread,
Jul 28, 2014, 8:53:09 PM7/28/14
to google-adm...@googlegroups.com
So I originally had this problem, and thought Java 1.7 fixed it, but now I can compile against Java 1.6 too and it works fine, even with the latest build tools. And I'm running Eclipse 4.3.2 for what it's worth.

I don't know what I changed, but I also wouldn't put it past Eclipse to have some setting or preference where it doesn't build in Google Play services correctly. I don't think it's a bug in the Play Services SDK.

When you build the sample app with play services, how big is your apk that is output to bin/? For reference, mine is about 1.4 MB, not proguarded.

Chris Hayton

unread,
Aug 12, 2014, 3:21:46 AM8/12/14
to google-adm...@googlegroups.com
I had the same problem and installing the latest build tools, then restarting eclipse and doing a clean build of both my project and the google play services lib fixed it for me.

Stephen Feather

unread,
Nov 19, 2014, 12:40:41 AM11/19/14
to google-adm...@googlegroups.com
I'll add to Chris Hayton's answer.
In my case, older build tools.
Reply all
Reply to author
Forward
0 new messages