Closed
Description
The camera plugin can not be used with Android API level 30 because it uses a deprecated method and warnings are treated as errors.
Steps to Reproduce
- Set compile and target API versions in your
build.gradle
file like to API level 30:
compileSdkVersion = 30
targetSdkVersion = 30
Logs
The build fails with this error:
/home/user/.pub-cache/hosted/pub.dartlang.org/camera-0.5.8+11/android/src/main/java/io/flutter/plugins/camera/Camera.java:333: warning: [deprecation] createCaptureSession(List<Surface>,StateCallback,Handler) in CameraDevice has been deprecated
cameraDevice.createCaptureSession(surfaceList, callback, null);
^
error: warnings found and -Werror specified
1 error
1 warning
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.3, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[!] Android Studio
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
✗ android-studio-dir = ~/Development/android-studio/
✗ Android Studio not found at ~/Development/android-studio/
[✓] Connected device (1 available)
! Doctor found issues in 1 category.