옐그's 코딩라이프

[Flutter] warning: [deprecation] get(int,int) in CamcorderProfile has been deprecated 해결 본문

Flutter

[Flutter] warning: [deprecation] get(int,int) in CamcorderProfile has been deprecated 해결

옐그멍이 2022. 9. 20. 20:52
C:\Users\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\camera_android-0.9.8+3\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:154: warning: [deprecation] get(int,int) in CamcorderProfile has been deprecated
          return CamcorderProfile.get(cameraId, CamcorderProfile.QUALITY_HIGH);
                                 ^
C:\Users\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\camera_android-0.9.8+3\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:158: warning: [deprecation] get(int,int) in CamcorderProfile has been deprecated
          return CamcorderProfile.get(cameraId, CamcorderProfile.QUALITY_2160P);
                                 ^
C:\Users\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\camera_android-0.9.8+3\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:162: warning: [deprecation] get(int,int) in CamcorderProfile has been deprecated
          return CamcorderProfile.get(cameraId, CamcorderProfile.QUALITY_1080P);
                                 ^
C:\Users\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\camera_android-0.9.8+3\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:166: warning: [deprecation] get(int,int) in CamcorderProfile has been deprecated
          return CamcorderProfile.get(cameraId, CamcorderProfile.QUALITY_720P);
                                 ^
C:\Users\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\camera_android-0.9.8+3\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:170: warning: [deprecation] get(int,int) in CamcorderProfile has been deprecated
          return CamcorderProfile.get(cameraId, CamcorderProfile.QUALITY_480P);
                                 ^
C:\Users\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\camera_android-0.9.8+3\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:174: warning: [deprecation] get(int,int) in CamcorderProfile has been deprecated
          return CamcorderProfile.get(cameraId, CamcorderProfile.QUALITY_QVGA);
                                 ^
C:\Users\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\camera_android-0.9.8+3\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:178: warning: [deprecation] get(int,int) in CamcorderProfile has been deprecated
          return CamcorderProfile.get(cameraId, CamcorderProfile.QUALITY_LOW);
                                 ^
7 warnings
Note: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\file_picker-5.1.0\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerDelegate.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

warning이어서 빌드는 잘 되지만 ... 그래도 찝찝하니까 구글링을 함 해줬습니당

https://github.com/flutter/flutter/issues/89578 <- 참고했고

주석 처리 된게 before이고 새로 써진게 after입니당

pubspec.yaml 파일에 dependencies에 보면 camera를 직접 불러오는게 아니라 git으로 불러오게 바꿔줍니다

dependencies:
  camera:
    git:
      url: https://github.com/flutter/plugins
      path: packages/camera/camera
      ref: 9e46048ad2e1f085c1e8f6c77391fa52025e681f

이걸로 바꿔 써주고 터미널에 

$ flutter pub get

명령어를 쳐주면 끝!

경고 뜨는 것 없이 빌드가 잘되네용!

728x90