8000 [Camera] Can not use the camera plugin with Android API level 30 · Issue #69883 · flutter/flutter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
[Camera] Can not use the camera plugin with Android API level 30 #69883
Closed
flutter/plugins
#3299
@Max-Might

Description

@Max-Might

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

  1. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    p: cameraThe camera pluginpackageflutter/packages repository. See also p: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0