title: Why doesn't a camera open with flutter?
body: <p>I am trying to make a camera open using flutter and this is what I get:</p>
  <p>E/flutter (26189): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method availableCameras on channel plugins.flutter.io/camera)</p>
  <p>E/flutter (26189): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:157:7)</p>
  <p>E/flutter (26189): &lt; asynchronous suspension&gt;</p>
  <p>E/flutter (26189): #1      availableCameras (package:camera/camera.dart:56:9)</p>
  <p>E/flutter (26189): &lt; asynchronous suspension&gt;</p>
  <p>E/flutter (26189): #2      main (package:flutter_realtime_detection/main.dart:11:15)</p>
  <p>E/flutter (26189): &lt; asynchronous suspension&gt;</p>
  <p>this is the line flutter does not accept:</p>
  <pre><code>Future&lt;Null&gt; main() async {
     WidgetsFlutterBinding.ensureInitialized();
     try {
        cameras = await availableCameras();
     } on CameraException catch (e) {
        print('Error: $e.code\nError Message: $e.message');
     }
     runApp(new MyApp());
  }
  </code></pre>
  <p>I have tried flutter clean, hot reloads but nothing helps(</p>
  <p>Here is <strong>flutter doctor -v</strong>:</p>
  <pre><code>[✓] Flutter (Channel master, 1.24.0-8.0.pre.342, on macOS 11.1 20C69 darwin-x64, locale en-GB)
      • Flutter version 1.24.0-8.0.pre.342 at /Users/fimarubin/Developer/flutter \
      • Framework revision 226532b157 (4 weeks ago), 2020-11-21 12:08:04 +0100\
      • Engine revision 23a8e027db\
      • Dart version 2.12.0 (build 2.12.0-62.0.dev)
  
  [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)\
      • Android SDK at /Users/fimarubin/Library/Android/sdk\
      • Platform android-30, build-tools 30.0.2\
      • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java\
      • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)\
      • All Android licenses accepted.
  
  [✓] Xcode - develop for iOS and macOS (Xcode 12.3)\
      • Xcode at /Applications/Xcode.app/Contents/Developer\
      • Xcode 12.3, Build version 12C33\
      • CocoaPods version 1.10.0
  
  [✓] Android Studio (version 4.1)\
      • 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\
      • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
  
  [✓] Connected device (1 available)\
      • SM G9750 (mobile) • R28M31Y893Y • android-arm64 • Android 10 (API 29)
  
  • No issues found!
  </code></pre>