-
Notifications
You must be signed in to change notification settings - Fork 29k
Closed
flutter/plugins
#4423Closed
Copy link
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listfound in release: 2.2Found to occur in 2.2Found to occur in 2.2found in release: 2.6Found to occur in 2.6Found to occur in 2.6has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: cameraThe camera pluginThe camera pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyAndroid applications specifically
Description
The camera plugin can not be used with Android API level 31 because it uses a deprecated method and warnings are treated as errors.
Steps to Reproduce
- Start new project and use latest camera plugin
- Set compile and target API versions in your build.gradle file to API level 31:
compileSdkVersion = 31
targetSdkVersion = 31
flutter build apk
Expected results: Build is successful
Actual results: Build fails with 8 warnings, treated as one error.
camera/features/resolution/ResolutionFeature.java:135: warning: [deprecation] get(int,int) in CamcorderProfile has been deprecated
return CamcorderProfile.get(cameraId, CamcorderProfile.QUALITY_HIGH);
^
camera/features/resolution/ResolutionFeature.java:139: warning: [deprecation] get(int,int) in CamcorderProfile has been deprecated
return CamcorderProfile.get(cameraId, CamcorderProfile.QUALITY_2160P);
^
camera/features/resolution/ResolutionFeature.java:143: warning: [deprecation] get(int,int) in CamcorderProfile has been deprecated
return CamcorderProfile.get(cameraId, CamcorderProfile.QUALITY_1080P);
^
camera/features/resolution/ResolutionFeature.java:147: warning: [deprecation] get(int,int) in CamcorderProfile has been deprecated
return CamcorderProfile.get(cameraId, CamcorderProfile.QUALITY_720P);
^
camera/features/resolution/ResolutionFeature.java:151: warning: [deprecation] get(int,int) in CamcorderProfile has been deprecated
return CamcorderProfile.get(cameraId, CamcorderProfile.QUALITY_480P);
^
camera/features/resolution/ResolutionFeature.java:155: warning: [deprecation] get(int,int) in CamcorderProfile has been deprecated
return CamcorderProfile.get(cameraId, CamcorderProfile.QUALITY_QVGA);
^
camera/features/resolution/ResolutionFeature.java:159: warning: [deprecation] get(int,int) in CamcorderProfile has been deprecated
return CamcorderProfile.get(cameraId, CamcorderProfile.QUALITY_LOW);
^
error: warnings found and -Werror specified
camera/media/MediaRecorderBuilder.java:15: warning: [deprecation] MediaRecorder() in MediaRecorder has been deprecated
return new MediaRecorder();
^
1 error
8 warnings
This affects #89511 which relands flutter/engine#24756 which requires Android API 31.
@blasten I'm pinging you here since you are most familiar with the affected issues and you also seem to have solved this in the past, when the camera did not work with API 30 flutter/plugins#3299 - I intend to also open a PR for this issue, but I still think you should be in the loop.
llleodeleon, Tom3652, RafaelBarbosatec, ARanjithReddy306, phuchuynhStrong and 23 more
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listfound in release: 2.2Found to occur in 2.2Found to occur in 2.2found in release: 2.6Found to occur in 2.6Found to occur in 2.6has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: cameraThe camera pluginThe camera pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyAndroid applications specifically