我不知道为什么会出现这个错误。我没有更新任何东西。我从 google api 控制台生成了新 key ,但错误仍然出现。我想做这个例子 [带有 Google Places API 的 Android SearchView 小部件][1]。
调试->资源->值->google_maps_api.xml
我也有一个具有相同结构的发布文件夹,并且我在两个文件中输入了相同的 key 。
日志:
3151-3151/com.example.onur I/Google Maps Android API﹕ Google Play services client version: 4242000
07-18 10:28:13.655 3151-3151/com.example.onur I/dalvikvm﹕ Could not find method guj.a, referenced from method gqi.a
07-18 10:28:13.655 3151-3151/com.example.onur W/dalvikvm﹕ VFY: unable to resolve static method 24936: Lguj;.a (Landroid/content/Context;)Lgri;
07-18 10:28:13.655 3151-3151/com.example.onur D/dalvikvm﹕ VFY: replacing opcode 0x71 at 0x0003
07-18 10:28:13.665 3151-3151/com.example.onur E/dalvikvm﹕ Could not find class 'gpr', referenced from method gps.a
07-18 10:28:13.665 3151-3151/com.example.onur W/dalvikvm﹕ VFY: unable to resolve new-instance 4090 (Lgpr;) in Lgps;
07-18 10:28:13.665 3151-3151/com.example.onur D/dalvikvm﹕ VFY: replacing opcode 0x22 at 0x0000
07-18 10:28:13.665 3151-3151/com.example.onur E/dalvikvm﹕ Could not find class 'gpr', referenced from method gps.a
07-18 10:28:13.665 3151-3151/com.example.onur W/dalvikvm﹕ VFY: unable to resolve new-instance 4090 (Lgpr;) in Lgps;
07-18 10:28:13.665 3151-3151/com.example.onur D/dalvikvm﹕ VFY: replacing opcode 0x22 at 0x0000
07-18 10:28:13.665 3151-3151/com.example.onur E/dalvikvm﹕ Could not find class 'gpr', referenced from method gps.a
07-18 10:28:13.665 3151-3151/com.example.onur W/dalvikvm﹕ VFY: unable to resolve new-instance 4090 (Lgpr;) in Lgps;
07-18 10:28:13.665 3151-3151/com.example.onur D/dalvikvm﹕ VFY: replacing opcode 0x22 at 0x0000
07-18 10:28:13.665 3151-3151/com.example.onur D/dalvikvm﹕ DexOpt: unable to opt direct call 0x5ea3 at 0x0a in Lgps;.a
07-18 10:28:13.665 3151-3151/com.example.onur D/dalvikvm﹕ DexOpt: unable to opt direct call 0x5ea3 at 0x0c in Lgps;.a
07-18 10:28:13.665 3151-3151/com.example.onur D/dalvikvm﹕ DexOpt: unable to opt direct call 0x5ea3 at 0x0a in Lgps;.a
07-18 10:28:13.685 3151-3151/com.example.onur I/Google Maps Android API﹕ Google Play services package version: 5084036
07-18 10:28:13.695 3151-3151/com.example.onur W/dalvikvm﹕ VFY: unable to resolve static field 20873 (t) in Lyp;
07-18 10:28:13.695 3151-3151/com.example.onur D/dalvikvm﹕ VFY: replacing opcode 0x62 at 0x000e
07-18 10:28:13.700 3151-3151/com.example.onur W/dalvikvm﹕ VFY: unable to resolve static field 20873 (t) in Lyp;
07-18 10:28:13.700 3151-3151/com.example.onur D/dalvikvm﹕ VFY: replacing opcode 0x62 at 0x000d
07-18 10:28:13.890 3151-3151/com.example.onur D/dalvikvm﹕ GC_FOR_ALLOC freed 502K, 15% free 9978K/11648K, paused 29ms, total 29ms
07-18 10:28:14.065 3151-3454/com.example.onur D/dalvikvm﹕ GC_FOR_ALLOC freed 313K, 14% free 10119K/11660K, paused 17ms, total 17ms
07-18 10:28:14.155 3151-3151/com.example.onur I/dalvikvm﹕ Failed resolving Lcom/google/android/gms/location/internal/ParcelableGeofence; interface 4023 'Lgln;'
07-18 10:28:14.155 3151-3151/com.example.onur W/dalvikvm﹕ Link of class 'Lcom/google/android/gms/location/internal/ParcelableGeofence;' failed
07-18 10:28:14.155 3151-3151/com.example.onur E/dalvikvm﹕ Could not find class 'com.google.android.gms.location.internal.ParcelableGeofence', referenced from method glt.a
07-18 10:28:14.155 3151-3151/com.example.onur W/dalvikvm﹕ VFY: unable to resolve check-cast 2086 (Lcom/google/android/gms/location/internal/ParcelableGeofence;) in Lglt;
[1]: http://wptrafficanalyzer.in/blog/android-searchview-widget-with-google-places-api-using-actionbarsherlock-library/
[2]: http://i.stack.imgur.com/R8fGG.jpg
最佳答案
我有几个解决方案:
- 您首先尝试过重新生成您的 API key 吗?
- 当你进入 google console ,它说你的包裹名称是什么?确保它是您的 map Activity 所在的正确包。
- 完成这两项操作后,确保清除数据或卸载您正在使用的应用程序 - settings -> apps -> my_app -> 或者清除数据或卸载
那有用吗?让我知道。
关于java - 找不到从方法 gps.a 引用的类 'gpr',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24821249/