Repository: flutter
Issue: [camera] `Reply already submitted [io.flutter.embedding.engine.dart.DartMessenger$Reply.reply]`
Labels: c: crash,platform-android,p: camera,package,P2,c: fatal crash,team-android,triaged-android

## Bug

A permission request was made from the Camera package and the "reply" seems to cause a crash sometimes.
I have several permission to ask in my application at app start but only this one cause the crash sometimes.

## Steps to Reproduce

Unfortunately it happened only 2 times in my Android app so i have no idea about any pattern but i don't think this should crash anyway...

**Expected results:** The application should not crash.

**Actual results:**  The application crashes.

<details>
  <summary>Logs</summary>

The crash is the following :

```
Caused by java.lang.IllegalStateException: Reply already submitted
       at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:155)
       at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:238)
       at io.flutter.plugins.camera.MethodCallHandlerImpl.instantiateCamera(MethodCallHandlerImpl.java:372)
       at io.flutter.plugins.camera.MethodCallHandlerImpl.lambda$onMethodCall$0$MethodCallHandlerImpl(MethodCallHandlerImpl.java:77)
       at io.flutter.plugins.camera.-$$Lambda$MethodCallHandlerImpl$kQOHgMggqzdMNqkzF-YukQrdRi8.onResult(:6)
       at io.flutter.plugins.camera.CameraPermissions.lambda$requestPermissions$0$CameraPermissions(CameraPermissions.java:42)
       at io.flutter.plugins.camera.-$$Lambda$CameraPermissions$IhmZy8WSUCwcg_h9O1MddE1ucIA.onResult(:4)
       at io.flutter.plugins.camera.CameraPermissions$CameraRequestPermissionsListener.onRequestPermissionsResult(CameraPermissions.java:97)
       at io.flutter.embedding.engine.FlutterEngineConnectionRegistry$FlutterEngineActivityPluginBinding.onRequestPermissionsResult(FlutterEngineConnectionRegistry.java:712)
       at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.onRequestPermissionsResult(FlutterEngineConnectionRegistry.java:412)
       at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onRequestPermissionsResult(FlutterActivityAndFragmentDelegate.java:627)
       at io.flutter.embedding.android.FlutterActivity.onRequestPermissionsResult(FlutterActivity.java:648)
       at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:8463)
       at android.app.Activity.dispatchActivityResult(Activity.java:8313)
       at android.app.ActivityThread.deliverResults(ActivityThread.java:5176)
       at android.app.ActivityThread.handleSendResult(ActivityThread.java:5224)
       at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
       at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:151)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:111)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2213)
       at android.os.Handler.dispatchMessage(Handler.java:107)
       at android.os.Looper.loop(Looper.java:238)
       at android.app.ActivityThread.main(ActivityThread.java:7864)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:512)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:998)
```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
[✓] Flutter (Channel stable, 2.2.3, on macOS 11.5.2 20G95 darwin-x64, locale fr-FR)
    • Flutter version 2.2.3 at /Users/foxtom/Desktop/flutter
    • Framework revision f4abaa0735 (7 weeks ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/foxtom/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /usr/local/Cellar/openjdk@8/1.8.0+282/libexec/openjdk.jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_282-bre_2021_01_20_16_06-b00)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5.1, Build version 12E507
    • CocoaPods version 1.10.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] Connected device (3 available)
    • CPH1931 (mobile) • ee9b32b5 • android-arm64  • Android 10 (API 29)
    • macOS (desktop)  • macos    • darwin-x64     • macOS 11.5.2 20G95 darwin-x64
    • Chrome (web)     • chrome   • web-javascript • Google Chrome 92.0.4515.159

! Doctor found issues in 1 category.
```

</details>