-
-
Notifications
You must be signed in to change notification settings - Fork 659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: FusedLocationClient.isLocationServiceEnabled crashes #1366
Comments
E/AndroidRuntime(12981): FATAL EXCEPTION: main |
I have the same error, @TimHoogstrate is your PR a solution for this error, do you plan to send it for merge? |
Still happening... |
hi @greg-tekai-com @TimHoogstrate is there any way to reproduce this? Does the PR has been tested to fix the issue? We have similar reports to this, a little bit different but the same reason which is related to connectivity issues.
|
attaching here also the similar issue with react native, and with their solution. Actually, its not a solution but just hides the actual error. But since the error is coming from Google itself, what we can do is to wait for them to fix the actual issue. similar RN issue: Agontuk/react-native-geolocation-service#137 |
We encounter the same problem when calling
|
I am also encountering it on Android. Is there any work planned regarding resolving that? |
hi @greg-tekai-com , I forcefully replicated the issue by simply intentionally throwing the same error that we're encountering. I managed to successfully add a proper error handling, and was able to handle it on the Flutter side. For the mean time while waiting for the contributors to review the PR, I forked the library, specifically the geolocator_android, apply the fix and overrides the geolocator_android dependency in our pubspec.yaml. |
Is there any update related to this issue? |
We have tons of crashes related to this issue. Any update? |
Please check the following before submitting a new issue.
Please select affected platform(s)
Steps to reproduce
I'm unable to reproduce a disconnect locally, but we have thousands of crash reports with the stack trace captured in the actual results when we get disconnected from play services.
We're pretty sure that the bug is within FusedLocationClient.isLocationServiceEnabled. If the response is not successful, it calls listener.onLocationServiceError(), but doesn't exit, and all other paths from this point are attempting to return a second result which would also crash.
In our case, after returning an error via onLocationServiceError, the method calls response.getResult which throws an exception if the result was not successful as per docs. This exception is not caught and causes the thread to crash.
Interestingly, it's primarily Amazon fire devices (~90%) that get disconnected, but we do see Pixels and Galaxy phones along with some others.
Expected results
If we get disconnected from services, it should simply call result.error once and return.
Actual results
The thread crashes with:
Stack trace
Code sample
Code sample
Screenshots or video
Screenshots or video demonstration
[Upload media here]
Version
10.1.0
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: