Hi all,
I am working on an application that uses the location event. It works fine on iOS, however it crashes on Android as soon as I run the line below, and my callback is not even called.
Runtime:addEventListener( "location", locationListenerRef )
Here is the log I get (adb logcat) :
E/AndroidRuntime( 7300): java.lang.IllegalArgumentException: provider doesn't exist: gps E/AndroidRuntime( 7300): at android.os.Parcel.readException(Parcel.java:1469) E/AndroidRuntime( 7300): at android.os.Parcel.readException(Parcel.java:1419) E/AndroidRuntime( 7300): at android.location.ILocationManager$Stub$Proxy.requestLocationUpdates(ILocationManager.java:540) E/AndroidRuntime( 7300): at android.location.LocationManager.requestLocationUpdates(LocationManager.java:860) E/AndroidRuntime( 7300): at android.location.LocationManager.requestLocationUpdates(LocationManager.java:454) E/AndroidRuntime( 7300): at com.ansca.corona.CoronaSensorManager$1.run(CoronaSensorManager.java:180) E/AndroidRuntime( 7300): at android.os.Handler.handleCallback(Handler.java:733) E/AndroidRuntime( 7300): at android.os.Handler.dispatchMessage(Handler.java:95) E/AndroidRuntime( 7300): at android.os.Looper.loop(Looper.java:136) E/AndroidRuntime( 7300): at android.app.ActivityThread.main(ActivityThrea
I have been spending 2 days on this bug, searching the web for a solution. It seems this bug was already mentionned on this forum, but no solution was given:
As expected for using GPS, my Android settings for usesPermissions are:
“android.permission.ACCESS_FINE_LOCATION”
“android.permission.ACCESS_COARSE_LOCATION”
Of course, I want to use GPS, but not make it required for installing the application in Google Play, so I also have in usesFeatures:
{ name = “android.hardware.location.gps”, required = false },
If the device lacks GPS, the expected behavior would be that my callback is called with event.errorCode and event.errorMessage filled with relevant values, and not an internal crash that stops the application.
Really hope to read some advice.
Thanks.
Regards