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

PlatformException when reopening exited app #587

Closed
saaivignesh20-zz opened this issue Jun 16, 2021 · 1 comment
Closed

PlatformException when reopening exited app #587

saaivignesh20-zz opened this issue Jun 16, 2021 · 1 comment
Labels

Comments

@saaivignesh20-zz
Copy link

saaivignesh20-zz commented Jun 16, 2021

Reopening the app after exit with disabled location yields PlatformException.

To reproduce the problem, I would launch the app, click "No thanks", which will in return exits the app with SystemNavigator.pop(). If I open the app again, exception is thrown.

This only seem to happen on real device, I didn't notice them in emulator.

If I close the app with exit(0) (which is not a recommended method), this exception doesn't occur.

Expected behavior
Expected behaviour is to open the location dialog again.

Tested on:

  • Android, API Level 30, real device (Xiaomi Poco F1)
  • Android, API Level 23, emulator (AVD)

Log:
D/LocationPlugin(11170): Service connected: ComponentInfo{com.gms.mobileapp/com.lyokone.location.FlutterLocationService}
E/MethodChannel#lyokone/location(11170): Failed to handle method call
E/MethodChannel#lyokone/location(11170): android.content.ActivityNotFoundException
E/MethodChannel#lyokone/location(11170): at com.lyokone.location.FlutterLocation.requestService(FlutterLocation.java:375)
E/MethodChannel#lyokone/location(11170): at com.lyokone.location.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.java:55)
E/MethodChannel#lyokone/location(11170): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/MethodChannel#lyokone/location(11170): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/MethodChannel#lyokone/location(11170): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
E/MethodChannel#lyokone/location(11170): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#lyokone/location(11170): at android.os.MessageQueue.next(MessageQueue.java:335)
E/MethodChannel#lyokone/location(11170): at android.os.Looper.loop(Looper.java:183)
E/MethodChannel#lyokone/location(11170): at android.app.ActivityThread.main(ActivityThread.java:7663)
E/MethodChannel#lyokone/location(11170): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#lyokone/location(11170): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/MethodChannel#lyokone/location(11170): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
E/DartMessenger(11170): Uncaught exception in binary message listener
E/DartMessenger(11170): java.lang.IllegalStateException: Reply already submitted
E/DartMessenger(11170): at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:155)
E/DartMessenger(11170): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:253)
E/DartMessenger(11170): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/DartMessenger(11170): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
E/DartMessenger(11170): at android.os.MessageQueue.nativePollOnce(Native Method)
E/DartMessenger(11170): at android.os.MessageQueue.next(MessageQueue.java:335)
E/DartMessenger(11170): at android.os.Looper.loop(Looper.java:183)
E/DartMessenger(11170): at android.app.ActivityThread.main(ActivityThread.java:7663)
E/DartMessenger(11170): at java.lang.reflect.Method.invoke(Native Method)
E/DartMessenger(11170): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/DartMessenger(11170): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
[log] PlatformException(MISSING_ACTIVITY, You should not requestService activation outside of an activity., null, null)
[log] #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:597:7)
#1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:158:18)

#2 MethodChannelLocation.requestService (package:location_platform_interface/src/method_channel_location.dart:137:25)

#3 LocationProvider.getLocation (package:flutter_gms/LocationProvider.dart:19:25)

@saaivignesh20-zz saaivignesh20-zz changed the title PlatformException when PlatformException when reopening exited app Jun 16, 2021
@stale
Copy link

stale bot commented Jul 21, 2021

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.

@stale stale bot added the inactive label Jul 21, 2021
@stale stale bot closed this as completed Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant