title: Flutter App crashes emulator when opening camera
body: <p>I am trying to build a bar code scanner app in Flutter. For this, I am using <a href="https://pub.dev/packages/barcode_scan" rel="nofollow noreferrer">this</a> plugin. I added it to <code>pubspec.yaml</code>, modified the <code>AndroidMainfest.xml</code> file and added the simple code as below:</p>
  
  <pre><code>Future _scanQR() async {
      try {
        var qrResult = await BarcodeScanner.scan();
        result = qrResult as String;
      } catch (ex) {
  //      result = "Unknown Error $ex";
      }
    }
  </code></pre>
  
  <p>The above method is invoked on a button press. So the app loads and I click the button, the whole emulator crashes without any logs or error message. Here is the <a href="https://pastebin.com/Cn10n7p2" rel="nofollow noreferrer">whole logcat</a> I recorded during the flow. In the end, it says </p>
  
  <pre><code>2020-04-19 20:20:21.285 1740-2027/? I/Camera2ClientBase: Camera 0: Opened. Client: io.yeshwanthvshenoy.addup (PID 4260, UID 10086)
  </code></pre>
  
  <p><a href="https://pastebin.com/i7SGjTnv" rel="nofollow noreferrer">Here</a> is another log from the default camera app. I can't seem to find out why this is happening. My emulator settings are all default, I didn't change any setting except the back camera one which is set to <code>Webcam0</code>. The possible options where <code>virtual scene</code>, <code>none</code>, <code>emulated</code> and <code>webcam0</code>. Is it maybe that my Mac is not giving permissions to AVD to access camera? How can I check that if so??</p>