Open tonyseben opened 4 years ago
I had the same issue when the location permission got removed while smartlocation was running.
Obviously this check should wrap the if(singleUpdate)
one
https://github.com/mrmans0n/smart-location-lib/blob/8939ae96140e1a469f40a2dde1489002faca10ad/library/src/main/java/io/nlopez/smartlocation/location/providers/LocationManagerProvider.java#L52
In the meantime, one can silently catch the exception by registering a custom exception handler after crashlytics init Application#onCreate()
/**
* To be registered after Crashlytics init
* Catch for https://github.com/mrmans0n/smart-location-lib/issues/277
*/
private void handleSmartLocationExceptionSilently() {
final Thread.UncaughtExceptionHandler defaultExceptionHandler = getDefaultUncaughtExceptionHandler();
setDefaultUncaughtExceptionHandler((t, e) -> {
if (e != null && e.getStackTrace() != null
&& e.getStackTrace().length > 6
&& e.getStackTrace()[6].toString().contains("io.nlopez.smartlocation")
&& e.getMessage() != null
&& e.getMessage().contains("location provider requires")) {
return;
}
if (defaultExceptionHandler != null) {
defaultExceptionHandler.uncaughtException(t, e);
}
});
}
Found this SecurityException in my Crashlytics reports after integrating your sdk. Let me know How I can handle this issue.