简体   繁体   中英

Android Google Maps gives a ClassNotFoundException

I am creating an app tht uses Google Maps API v2. It works fine, except for a little annoying this, when I use the setMyLocationEnabled(true); method, I get a ClassNotFoundException . I can just click "Resume" and the app continues. When running without debugger, there is nothing you can see happening.

This is what LogCat is saying:

09-23 22:39:31.645: I/dalvikvm(2067): Failed resolving Lcom/google/android/gms/location/internal/ParcelableGeofence; interface 4023 'Lglm;'
09-23 22:39:31.645: W/dalvikvm(2067): Link of class 'Lcom/google/android/gms/location/internal/ParcelableGeofence;' failed
09-23 22:39:32.473: W/dalvikvm(2067): VFY: unable to resolve static field 4203 (CREATOR) in Lcom/google/android/gms/location/internal/ParcelableGeofence;

It looks like a missing class in the library, and if I jump into the library project, I indeed do not see that class.

Is there anything I can add / fix to make this exception go away?

I have seen that logcat error before and I noticed it is due to mismatch in my API key between debug and release mode. If you are using separate key store for debug, please make sure you have included both debug and release SHA1+package.name combos in the Google Dev Console.

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