我在安装Android Studio并从SDK Manager为我的平台,google play服务和google存储库安装所有需要的SDK后,创建了一个非常基本的android地图活动应用程序。 但是当我启动应用程序而不管我为设备设置的API级别时,我会在模拟器启动时立即收到消息“SampleApplication将无法运行,除非您使用”更新“按钮更新Google Play服务。 单击更新按钮会使应用程序崩溃,我会在日志中看到这一点:
08-20 13:07:35.225 1768-1768/? D/dalvikvm? Not late-enabling CheckJNI (already on) 08-20 13:07:35.565
1768-1768/example.com.sampleMapApp E/Trace? error opening trace file: No such file or directory (2) 08-20 13:07:35.875
1768-1768/example.com.sampleMapApp I/dalvikvm? Could not find method android.app.Notification$Builder.setLocalOnly,
referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zza 08-20 13:07:35.875
1768-1768/example.com.sampleMapApp W/dalvikvm? VFY: unable to resolve virtual method 242:
Landroid/app/Notification$Builder;.setLocalOnly (Z)Landroid/app/Notification$Builder; 08-20 13:07:35.875
1768-1768/example.com.sampleMapApp D/dalvikvm? VFY: replacing opcode 0x6e at 0x00c2 08-20 13:07:35.885
1768-1768/example.com.sampleMapApp I/dalvikvm? DexOpt: access denied from Lcom/google/android/gms/common/GooglePlayServicesUtil;
to field Landroid/app/Notification;.extras 08-20 13:07:35.885
1768-1768/example.com.sampleMapApp W/dalvikvm? VFY: unable to resolve instance field 18 08-20 13:07:35.885
1768-1768/example.com.sampleMapApp D/dalvikvm? VFY: replacing opcode 0x54 at 0x00e1 08-20 13:07:35.895
1768-1768/example.com.sampleMapApp E/dalvikvm? Could not find class 'android.app.AppOpsManager',
referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zza 08-20 13:07:35.895
1768-1768/example.com.sampleMapApp W/dalvikvm? VFY: unable to resolve check-cast 25 (Landroid/app/AppOpsManager;)
in Lcom/google/android/gms/common/GooglePlayServicesUtil; 08-20 13:07:35.895
1768-1768/example.com.sampleMapApp D/dalvikvm? VFY: replacing opcode 0x1f at 0x000e 08-20 13:07:35.905
1768-1768/example.com.sampleMapApp I/dalvikvm? Could not find method android.content.pm.PackageManager.getPackageInstaller,
referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zzh 08-20 13:07:35.905
1768-1768/example.com.sampleMapApp W/dalvikvm? VFY: unable to resolve virtual method 532:
Landroid/content/pm/PackageManager;.getPackageInstaller ()Landroid/content/pm/PackageInstaller; 08-20 13:07:35.905
1768-1768/example.com.sampleMapApp D/dalvikvm? VFY: replacing opcode 0x6e at 0x000b 08-20 13:07:35.935
1768-1768/example.com.sampleMapApp W/GooglePlayServicesUtil? Google Play services out of date.
Requires 7571000 but found 3136130 08-20 13:07:35.946 1768-1768/example.com.sampleMapApp W/GooglePlayServicesUtil? Google Play services out of date.
Requires 7571000 but found 3136130 08-20 13:07:35.955 1768-1768/example.com.sampleMapApp W/GooglePlayServicesUtil? Google Play services out of date.
Requires 7571000 but found 3136130 08-20 13:07:35.965 1768-1768/example.com.sampleMapApp W/GooglePlayServicesUtil? Google Play services out of date.
Requires 7571000 but found 3136130 08-20 13:07:35.975 1768-1768/example.com.sampleMapApp W/GooglePlayServicesUtil? Google Play services out of date.
Requires 7571000 but found 3136130 08-20 13:07:35.985 1768-1768/example.com.sampleMapApp W/GooglePlayServicesUtil? Google Play services out of date.
Requires 7571000 but found 3136130 08-20 13:07:36.005 1768-1768/example.com.sampleMapApp W/GooglePlayServicesUtil? Google Play services out of date.
Requires 7571000 but found 3136130 08-20 13:07:36.015 1768-1768/example.com.sampleMapApp W/GooglePlayServicesUtil? Google Play services out of date.
Requires 7571000 but found 3136130 08-20 13:07:36.035 1768-1768/example.com.sampleMapApp W/GooglePlayServicesUtil? Google Play services out of date.
Requires 7571000 but found 3136130 08-20 13:07:36.085 1768-1768/example.com.sampleMapApp W/GooglePlayServicesUtil? Google Play services out of date.
Requires 7571000 but found 3136130 08-20 13:07:36.106 1768-1768/example.com.sampleMapApp W/GooglePlayServicesUtil? Google Play services out of date.
Requires 7571000 but found 3136130 08-20 13:07:36.135 1768-1768/example.com.sampleMapApp W/GooglePlayServicesUtil? Google Play services out of date.
Requires 7571000 but found 3136130 08-20 13:07:36.156 1768-1768/example.com.sampleMapApp W/GooglePlayServicesUtil? Google Play services out of date.
Requires 7571000 but found 3136130 08-20 13:07:36.185 1768-1768/example.com.sampleMapApp W/GooglePlayServicesUtil? Google Play services out of date.
Requires 7571000 but found 3136130 08-20 13:07:36.205 1768-1768/example.com.sampleMapApp W/GooglePlayServicesUtil? Google Play services out of date.
Requires 7571000 but found 3136130 08-20 13:07:36.355 1768-1768/example.com.sampleMapApp D/libEGL? loaded /system/lib/egl/libEGL_emulation.so 08-20 13:07:36.355
1768-1768/example.com.sampleMapApp D/libEGL? loaded /system/lib/egl/libGLESv1_CM_emulation.so 08-20 13:07:36.376
1768-1768/example.com.sampleMapApp D/libEGL? loaded /system/lib/egl/libGLESv2_emulation.so 08-20 13:07:36.396
1768-1772/example.com.sampleMapApp D/dalvikvm? GC_CONCURRENT freed 259K, 12% free 2510K/2832K, paused 12ms+3ms, total 141ms 08-20 13:07:36.405
1768-1768/example.com.sampleMapApp D/? HostConnection::get() New Host Connection established 0x2a139d08, tid 1768 08-20 13:07:36.515
1768-1768/example.com.sampleMapApp W/EGL_emulation? eglSurfaceAttrib not implemented 08-20 13:07:36.556
1768-1768/example.com.sampleMapApp D/OpenGLRenderer? Enabling debug mode 0 08-20 13:08:57.456
1768-1768/example.com.sampleMapApp D/AndroidRuntime? Shutting down VM 08-20 13:08:57.456
1768-1768/example.com.sampleMapApp W/dalvikvm? threadid=1: thread exiting with uncaught exception (group=0x40a71930) 08-20 13:08:57.496
1768-1768/example.com.sampleMapApp E/AndroidRuntime? FATAL EXCEPTION: main
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=market://details?id=com.google.android.gms flg=0x80000 pkg=com.android.vending }
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1622)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1417)
at android.app.Activity.startActivityForResult(Activity.java:3370)
at android.app.Activity.startActivityForResult(Activity.java:3331)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:820)
at android.app.Activity.startActivity(Activity.java:3566)
at android.app.Activity.startActivity(Activity.java:3534)
at com.google.android.gms.dynamic.zza$5.onClick(Unknown Source)
at android.view.View.performClick(View.java:4204)
at android.view.View$PerformClick.run(View.java:17355)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method) 08-20 13:09:00.516 1768-1768/? I/Process? Sending signal. PID: 1768 SIG: 9"
After seeing this ("Google Play services out of date. Requires 7571000 but found 3136130") in the log,
I have tried installing the Google play services apk com.google.android.gms-v7.5.74 by using the terminal's "adb install" command to no avail.
请帮我弄清楚我错过了什么。
PS:我已经搜索了很多关于此问题的其他相关问题,但他们或多或少都指出谷歌播放服务可能没有安装的事实。答案 0 :(得分:0)
我可以通过为我的模拟器选择“Lollipop 22 x86 Google API”来解决我的问题。在此之前我使用Lollipop 22 x86_64 Android 5.1.1作为我的目标。在目标中添加Google API并更新SDK的所有待处理更新都为我解决了这个问题。 编辑:还有很多其他SDK用于不同风格的Android存在,我不得不清理,只保留API级别19及以上的工作。