-
-
Notifications
You must be signed in to change notification settings - Fork 783
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
Request to turn on the GPS is closing the app #370
Comments
Im using Flutter channel beta, v1.17.0-3.3.pre
Flutter doctor [√] Flutter (Channel beta, v1.17.0-3.3.pre, on Microsoft Windows [Version 10.0.16299.125], locale es-EC) |
I have the same issue |
Check if your code is running twice! In my case, the pettition for enable GPS was running twice, so the app crash. It solve the issue for me. |
Still having the same problem.I already checked my code but nothing run twice. |
I had the same issue when i request permission for user device location first and then for request for gps. At this time, it is calling two times and app is crashed with retry already submitted. I solved it like this : Note : not sure it is calling two times, but when i click first time on "No thanks button", it is not dismissing, then if i click again, app is crashing. |
I have same issue and app crashed with retry already submitted. Change to this it will clear @Override
public boolean onActivityResult(int requestCode, int resultCode, Intent data) {
if (result == null) {
return false;
}
switch (requestCode) {
case GPS_ENABLE_REQUEST:
if (resultCode == Activity.RESULT_OK) {
result.success(1);
} else {
result.success(0);
}
clearResultObj();
break;
case REQUEST_CHECK_SETTINGS:
if (resultCode == Activity.RESULT_OK) {
startRequestingLocation();
clearResultObj();
return true;
}
result.error("SERVICE_STATUS_DISABLED", "Failed to get location. Location services disabled", null);
clearResultObj();
return false;
default:
clearResultObj();
return false;
}
}
private void clearResultObj(){
result = null;
} |
Thank you all. I finally created a global variable to which I affect true as soon as I came out of the onActivityResult method as @rebaz94 did. And it works properly. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I have the same issue in the latest version: 3.0.2 & Flutter: 1.20 Please help me @Lyokone |
Hi I am facing issue in 3.2.4 |
I am facing issue in 4.4.0 |
When I request to enable service (activate the GPS), the app close, the GPS turn on but the app should be open again. ¿There is a method for don't have to reopen the app?
Tested on:
I'm trying with the repo example.
The text was updated successfully, but these errors were encountered: