【问题标题】:Android map application crashes on emulatorAndroid地图应用程序在模拟器上崩溃
【发布时间】:2015-11-14 05:06:26
【问题描述】:

在安装 Android Studio 并从 SDK 管理器安装我的平台、google play 服务和 google 存储库所需的所有 SDK 之后,我创建了一个非常基本的 android 地图活动应用程序。 但是,当我启动应用程序时,无论我为设备设置的 API 级别如何,我都会在模拟器启动后立即收到一条消息“除非您更新 Google Play 服务,否则 SampleApplication 将无法运行”并带有更新按钮。 单击更新按钮会使应用程序崩溃,我在日志中看到了这一点:

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:我已经搜索了很多关于此的其他相关问题,但它们或多或少都指向可能未安装 google play 服务的事实。

【问题讨论】:

    标签: android google-maps android-emulator google-play-services google-maps-api-2


    【解决方案1】:

    你的错误清楚地说明了

    1768-1768/example.com.sampleMapApp W/GooglePlayServicesUtil? Google Play services out of date.
    

    转到 SDK 管理和更新您的 Google API 并创建一个新的模拟器。

    【讨论】:

    • 谢谢,我想我已经尝试过了。不过我会再检查一次。
    【解决方案2】:

    我可以通过为我的模拟器选择“Lollipop 22 x86 Google APIs”来解决我的问题。在此之前,我使用 Lollipop 22 x86_64 Android 5.1.1 作为我的目标。在目标中添加 Google API 并更新我的 SDK 的所有待处理更新为我解决了这个问题。 编辑:还有很多其他适用于不同风格 android 的 SDK,我必须清理它们,并且只保留 API 级别 19 及以上才能正常工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-05-19
      • 2015-09-28
      • 2014-04-02
      • 1970-01-01
      • 2012-09-13
      • 1970-01-01
      • 2023-03-12
      • 1970-01-01
      相关资源
      最近更新 更多