IllegalArgumentException: provider=gps 处理方法

2,791 views

Android Market上有一次bug报告:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ADASiteMap/com.ADASiteMap.SiteMap}: java.lang.IllegalArgumentException: provider=gps

at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)

at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)

at android.app.ActivityThread.access$2300(ActivityThread.java:125)

at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)

at android.os.Handler.dispatchMessage(Handler.java:99)

at android.os.Looper.loop(Looper.java:123)

at android.app.ActivityThread.main(ActivityThread.java:4627)

at java.lang.reflect.Method.invokeNative(Native Method)

at java.lang.reflect.Method.invoke(Method.java:521)

at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)

at dalvik.system.NativeStart.main(Native Method)

Caused by: java.lang.IllegalArgumentException: provider=gps

at android.os.Parcel.readException(Parcel.java:1251)

at android.os.Parcel.readException(Parcel.java:1235)

at android.location.ILocationManager$Stub$Proxy.requestLocationUpdates(ILocationManager.java:516)

at android.location.LocationManager._requestLocationUpdates(LocationManager.java:711)

at android.location.LocationManager.requestLocationUpdates(LocationManager.java:630)

at com.ADASiteMap.SiteMap.setGPSPhoneListener(SiteMap.java:321)

at com.ADASiteMap.SiteMap.onCreate(SiteMap.java:182)

在网上查了一下是由于有些机油刷机的android版本中GPS包有问题,无法开启使用GPS功能,为了提升这小部分用户感知,只需在requestLocationUpdates时用try catch包住,打出开启出错提醒就可以了:”ADASitemap初始化GPS失败 ”

搜到的信息:

Hey all. Just wanted to let you know I found a minor bug with the Android app today. I run a rooted Android phone running v2.2 (Froyo) on my Eris. Today I installed our latest ROM and it had a corrupted GPS library therefor causing GPS to not function at all. Some of the apps that utilized GPS worked fine, while 3 others didn’t. GasBuddy, Yelp, and the default web browser all Force Closed due to the GPS issue. Other apps such as FourSquare, GPS Status, Google Maps, and others continued working fine, even without an active GPS. The following is the error in the app that caused me to notice the GPS issue today:

java.lang.IllegalArgumentException: provider=gps

Like I said, this is a minor bug that hopefully only us ROM hackers will come across, however I just wanted to pass this info on to you in hopes that you might spend a few seconds patching your code so that in the future, even without GPS, your app would still work, or a functioning GPS library

转载本站文章请注明,转载自:阿达基站路测的天空[http://blog.signalsitemap.com]

本文链接:IllegalArgumentException: provider=gps 处理方法 | 阿达基站路测的天空

This entry was posted in Android and tagged . Bookmark the permalink.

Comments are closed.