Google Play Services——谁在劫持我?



遵循https://developers.google.com/android/guides/setup的指南最初有NoClassDefFoundError。更新了Eclipse和Android SDK Manager中的所有内容,现在变成

07-15 23:56:09.700: W/dalvikvm(29054): Class resolved by unexpected DEX: Lcom/google/android/gms/internal/zzpq;(0x41fb8c30):0x52a43000 ref [[Lcom/google/android/gms/common/api/Scope;] Lcom/google/android/gms/common/api/Scope;(0x41fb8c30):0x529a2000
07-15 23:56:09.700: W/dalvikvm(29054): (Lcom/google/android/gms/internal/zzpq; had used a different [Lcom/google/android/gms/common/api/Scope; during pre-verification)
07-15 23:56:09.700: W/dalvikvm(29054): Exception Ljava/lang/IllegalAccessError; thrown while initializing Lcom/google/android/gms/internal/zzpq;
07-15 23:56:09.700: D/AndroidRuntime(29054): Shutting down VM
07-15 23:56:09.700: W/dalvikvm(29054): threadid=1: thread exiting with uncaught exception (group=0x4199ace0)
07-15 23:56:09.705: I/Process(29054): Sending signal. PID: 29054 SIG: 9
07-15 23:56:09.705: E/AndroidRuntime(29054): FATAL EXCEPTION: main
07-15 23:56:09.705: E/AndroidRuntime(29054): Process: com.mercurywireless, PID: 29054
07-15 23:56:09.705: E/AndroidRuntime(29054): java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
07-15 23:56:09.705: E/AndroidRuntime(29054):    at com.google.android.gms.internal.zzpq.<clinit>(Unknown Source)
07-15 23:56:09.705: E/AndroidRuntime(29054):    at com.google.android.gms.common.api.GoogleApiClient$Builder.<init>(Unknown Source)
07-15 23:56:09.705: E/AndroidRuntime(29054):    at com.mercurywireless.services.GPSService.onCreate(GPSService.java:159)
07-15 23:56:09.705: E/AndroidRuntime(29054):    at android.app.ActivityThread.handleCreateService(ActivityThread.java:2596)
07-15 23:56:09.705: E/AndroidRuntime(29054):    at android.app.ActivityThread.access$1800(ActivityThread.java:144)
07-15 23:56:09.705: E/AndroidRuntime(29054):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1287)
07-15 23:56:09.705: E/AndroidRuntime(29054):    at android.os.Handler.dispatchMessage(Handler.java:102)
07-15 23:56:09.705: E/AndroidRuntime(29054):    at android.os.Looper.loop(Looper.java:136)
07-15 23:56:09.705: E/AndroidRuntime(29054):    at android.app.ActivityThread.main(ActivityThread.java:5146)
07-15 23:56:09.705: E/AndroidRuntime(29054):    at java.lang.reflect.Method.invokeNative(Native Method)
07-15 23:56:09.705: E/AndroidRuntime(29054):    at java.lang.reflect.Method.invoke(Method.java:515)
07-15 23:56:09.705: E/AndroidRuntime(29054):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:732)
07-15 23:56:09.705: E/AndroidRuntime(29054):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566)
07-15 23:56:09.705: E/AndroidRuntime(29054):    at dalvik.system.NativeStart.main(Native Method)

internet上说这种错误是由于两次包含一个库而导致的。所以我已经从google_play_services_lib项目和我自己的项目中玩了构建路径,订单和出口等,但无济于事。我在想,不知怎的,另一个版本的google-play-services.jar在运行时被包含在我的应用程序的类路径中,而我却不知道。但是怎么才能看到发生了什么呢?或者我错过了什么?

我的Android是4.4.4 CyanogenMod;尽管谷歌说我可以在模拟器上测试它,但我无法这样做,因为它总是给出Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY输出,即使遵循上面链接的指南。在另一个模拟器上只得到

[2015-07-16 00:51:09 - CeresApp] Failed to install CeresApp.apk on device 'emulator-5554! [2015-07-16 00:51:09 - CeresApp] (null) [2015-07-16 00:51:09 - CeresApp] Launch canceled!

谢谢!

原因是清单文件中多余的一行:

<uses-library android:name="com.google.android.gms"/>

删除它,它就好了

相关内容

  • 没有找到相关文章

最新更新