Skip to content
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

Crash when denying location access twice #61

Closed
1 of 2 tasks
kaetemi opened this issue Aug 8, 2018 · 1 comment
Closed
1 of 2 tasks

Crash when denying location access twice #61

kaetemi opened this issue Aug 8, 2018 · 1 comment
Assignees
Labels
type: bug Something isn't working
Milestone

Comments

@kaetemi
Copy link

kaetemi commented Aug 8, 2018

🐛 Bug Report

First deny returns exception as expected
PlatformException(PERMISSION_DENIED, Access to location data denied, null)

Second time denying, the app crashes

D/AndroidRuntime( 3792): Shutting down VM
E/AndroidRuntime( 3792): FATAL EXCEPTION: main
E/AndroidRuntime( 3792): Process: app.infmarketplace, PID: 3792
E/AndroidRuntime( 3792): java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=34, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {app.infmarketplace/app.infmarketplace.MainActivity}: java.lang.IllegalStateException: Reply already submitted
E/AndroidRuntime( 3792): 	at android.app.ActivityThread.deliverResults(ActivityThread.java:4324)
E/AndroidRuntime( 3792): 	at android.app.ActivityThread.handleSendResult(ActivityThread.java:4367)
E/AndroidRuntime( 3792): 	at android.app.ActivityThread.-wrap19(Unknown Source:0)
E/AndroidRuntime( 3792): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1649)
E/AndroidRuntime( 3792): 	at android.os.Handler.dispatchMessage(Handler.java:105)
E/AndroidRuntime( 3792): 	at android.os.Looper.loop(Looper.java:164)
E/AndroidRuntime( 3792): 	at android.app.ActivityThread.main(ActivityThread.java:6541)
E/AndroidRuntime( 3792): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 3792): 	at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
E/AndroidRuntime( 3792): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
E/AndroidRuntime( 3792): Caused by: java.lang.IllegalStateException: Reply already submitted
E/AndroidRuntime( 3792): 	at io.flutter.view.FlutterNativeView$1.reply(FlutterNativeView.java:162)
E/AndroidRuntime( 3792): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.error(MethodChannel.java:199)
E/AndroidRuntime( 3792): 	at com.baseflow.flutter.plugin.geolocator.data.Result.error(Result.java:30)
E/AndroidRuntime( 3792): 	at com.baseflow.flutter.plugin.geolocator.tasks.LastKnownLocationTask.handleError(LastKnownLocationTask.java:40)
E/AndroidRuntime( 3792): 	at com.baseflow.flutter.plugin.geolocator.tasks.LocationTask$1.onRequestPermissionsResult(LocationTask.java:118)
E/AndroidRuntime( 3792): 	at io.flutter.app.FlutterPluginRegistry.onRequestPermissionsResult(FlutterPluginRegistry.java:175)
E/AndroidRuntime( 3792): 	at io.flutter.app.FlutterActivityDelegate.onRequestPermissionsResult(FlutterActivityDelegate.java:132)
E/AndroidRuntime( 3792): 	at io.flutter.app.FlutterActivity.onRequestPermissionsResult(FlutterActivity.java:134)
E/AndroidRuntime( 3792): 	at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:7388)
E/AndroidRuntime( 3792): 	at android.app.Activity.dispatchActivityResult(Activity.java:7239)
E/AndroidRuntime( 3792): 	at android.app.ActivityThread.deliverResults(ActivityThread.java:4320)
E/AndroidRuntime( 3792): 	... 9 more

Expected behavior

Return the exception again

Reproduction steps

Request last known location as follows

 try {
    Position position = await Geolocator().getLastKnownPosition(LocationAccuracy.medium);
    print(position); // May be null
  } catch (ex) {
    print(ex); // Or fail to give permissions
    // PlatformException(PERMISSION_DENIED, Access to location data denied, null)
  }

Configuration

Version: 1.4.0

Platform:

  • 📱 iOS
  • 🤖 Android
@mvanbeusekom mvanbeusekom self-assigned this Aug 13, 2018
@mvanbeusekom mvanbeusekom added the type: bug Something isn't working label Aug 13, 2018
@mvanbeusekom mvanbeusekom added this to the 1.4 milestone Aug 13, 2018
@mvanbeusekom
Copy link
Member

@kaetemi thanks for reporting this issue. This is indeed a bug which we will look into and solve with our next update (version 1.4.1), which should be released later this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants