Provider "gps" unknown exception while trying to remove TestProvider

Does anyone know why or resolved this issue that I have:

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 didn’t even get into the deprecated method. At first it does not work, trying to remove the provider.

Is this a mistake ?

EDIT:

In my code, I check for the presence of a "gps" provider in the list:

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

Strange that he worked .

+4
source share
1 answer

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

+1
source

All Articles