简体   繁体   English

Google地图Android版的自定义图标

[英]custom icon for google maps for android

 ArrayList<MarkerOptions> markers = new returnMapStuff().getStopsList(data); . . . for(int i=0; i<markers.size();i++){(markers.get(i)).icon(BitmapDescriptorFactory.fromPath("icons/star.png"));} 

 11-30 20:27:39.559 3026-3026/? W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0xa62e2288) 11-30 20:27:39.559 3026-3026/? E/AndroidRuntime﹕ FATAL EXCEPTION: main java.lang.RuntimeException: Unable to create service com.google.android.gms.gcm.GcmService: java.lang.SecurityException: attempting to read gservices without permission: Neither user 10050 nor current process has com.google.android.providers.gsf.permission.READ_GSERVICES. at android.app.ActivityThread.handleCreateService(ActivityThread.java:2373) at android.app.ActivityThread.access$1600(ActivityThread.java:130) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1277) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4745) 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:786) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.SecurityException: attempting to read gservices without permission: Neither user 10050 nor current process has com.google.android.providers.gsf.permission.READ_GSERVICES. at android.app.ContextImpl.enforce(ContextImpl.java:1319) at android.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:1348) at android.content.ContextWrapper.enforceCallingOrSelfPermission(ContextWrapper.java:448) at gsh.c(SourceFile:107) at gsh.a(SourceFile:121) at gsh.a(SourceFile:182) at bek.a(SourceFile:137) at com.google.android.gms.gcm.GcmService.onCreate(SourceFile:209) at android.app.ActivityThread.handleCreateService(ActivityThread.java:2363)            at android.app.ActivityThread.access$1600(ActivityThread.java:130)            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1277)            at android.os.Handler.dispatchMessage(Handler.java:99)            at android.os.Looper.loop(Looper.java:137)            at android.app.ActivityThread.main(ActivityThread.java:4745)            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:786)            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)            at dalvik.system.NativeStart.main(Native Method) 11-30 20:27:39.563 358-368/system_process W/ActivityManager﹕ Process com.google.android.gms has crashed too many times: killing! 

i wonder why my android map crushes when i am trying to implement a custom marker... how can i use custom icons for markers and what about the file type/size/resolution of the icon? 我不知道为什么当我尝试实现自定义标记时我的android地图会崩溃...我如何使用自定义图标作为标记,图标的文件类型/大小/分辨率又如何?

From your log it looks like this is the problem: 从您的日志来看,这似乎是问题所在:

Caused by: java.lang.SecurityException: attempting to read gservices without permission: Neither user 10050 nor current process has com.google.android.providers.gsf.permission.READ_GSERVICES.

Either you need to provide the permission in the manifest or if you did it may be a bug in google play servies. 您需要在清单中提供许可,或者如果这样做,可能是Google Play服务中的错误。

If you do a google search on READ_GSERVICES you will see several items that seem to indicate this is a bug in google play services. 如果您在READ_GSERVICES上进行Google搜索,您会看到几项似乎表明这是Google Play服务中的错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM