Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Provider "gps" unknown exception while trying to removeTestProvider

Does anyone know why or has resolved this issue I'm having:

09-21 11:49:45.007: WARN/System.err(22711): java.lang.IllegalArgumentException: Provider "gps" unknown
09-21 11:49:45.007: WARN/System.err(22711):     at android.os.Parcel.readException(Parcel.java:1251)
09-21 11:49:45.007: WARN/System.err(22711):     at android.os.Parcel.readException(Parcel.java:1235)
09-21 11:49:45.007: WARN/System.err(22711):     at android.location.ILocationManager$Stub$Proxy.removeTestProvider(ILocationManager.java:889)
09-21 11:49:45.007: WARN/System.err(22711):     at android.location.LocationManager.removeTestProvider(LocationManager.java:1008)

This answer does not solve since I don't even get into the deprecated method. It fails first while trying to remove the provider.

Is this a bug?

EDIT:

In my code I check the existence of the provider "gps" in the list:

 final String TEST_PROVIDER =  LocationManager.GPS_PROVIDER;    // "gps" 
 if (mLocationManager.getProvider(TEST_PROVIDER) != null) {
      mLocationManager.removeTestProvider(TEST_PROVIDER);
 }

Weird thing is that it was working before.

like image 438
kaneda Avatar asked Sep 21 '11 14:09

kaneda


1 Answers

I think removeTestProvider(TEST_PROVIDER) only works after you've called addTestProvider(TEST_PROVIDER).

like image 58
Ali Mohammadi Avatar answered Oct 14 '22 10:10

Ali Mohammadi