본문 바로가기
프로그래밍/개발 팁 공유

M1 Mac 에서 flutter 설치 시, flutter doctor --android-licenses 오류 종류 및 해결 방법

by 김모범 2023. 2. 10.
반응형

저와 같이 m1 mac 에서 flutter 설치 중 아래와 같은 오류 발생 시 참고 하시기 바랍니다.

 

1. 

username@machinename ~ % flutter doctor --android-licenses

The operation couldn’t be completed. Unable to locate a Java Runtime.

Please visit http://www.java.com for information on installing Java.

The operation couldn’t be completed. Unable to locate a Java Runtime.

Please visit http://www.java.com for information on installing Java.

 

해결 방법 : java 설치

 

2.

username@machinename ~ % flutter doctor --android-licenses

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/android/prefs/AndroidLocationsProvider has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(ClassLoader.java:756)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)

at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)

at java.net.URLClassLoader.access$100(URLClassLoader.java:74)

at java.net.URLClassLoader$1.run(URLClassLoader.java:369)

at java.net.URLClassLoader$1.run(URLClassLoader.java:363)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:362)

at java.lang.ClassLoader.loadClass(ClassLoader.java:418)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)

at java.lang.ClassLoader.loadClass(ClassLoader.java:351)

at java.lang.Class.getDeclaredMethods0(Native Method)

at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)

at java.lang.Class.privateGetMethodRecursive(Class.java:3048)

at java.lang.Class.getMethod0(Class.java:3018)

at java.lang.Class.getMethod(Class.java:1784)

at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:669)

at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:651)

 

해결 방법 : java 8(52) 말고 java 11(55) 설치 하세요

참고 문서 : https://www.inflearn.com/questions/53693/jar-을-실행할때-에러가-발생해요

 

jar 을 실행할때 에러가 발생해요 - 인프런 | 질문 & 답변

jar 을 실행할때 에러가 발생해요  이 에러를 어떻게 고치는지 알려주시면 감사여  C:\my_java\hello-spring\build\libs>java -jar hello-spring-0.0.1-SNAPSHOT.jar Exception in t...

www.inflearn.com

3. 

 

username@machinename ~ % flutter doctor

Doctor summary (to see all details, run flutter doctor -v):

[✓] Flutter (Channel stable, 3.7.2, on macOS 13.0.1 22A400 darwin-arm64, locale ko-KR)

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)

[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)

    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[!] Android Studio (version 2022.1)

    Unable to find bundled Java version.

[✓] Connected device (1 available)

[✓] HTTP Host Availability

 

해결방법 : 아래 순서대로 진행

1️⃣ 안드로이드 스튜디오 우클릭 - 패키지 내용 보기

 

 

 

 

2️⃣ Contents 폴더 진입

 

 

 

 

 

3️⃣jre 폴더 생성

 

 

 

 

 

 

4️⃣ jbr 폴더 진입

 

 

 

 

 

 

5️⃣ jbr 폴더 내 Contents 폴더 복사

 

 

 

 

 

 

 

6️⃣ 생성한 jre 폴더에 복사한 Contents 폴더 붙여넣기

 

 

 

 

 

 

참고 문서 : https://github.com/flutter/flutter/issues/118502

 

Unable to find bundled Java version · Issue #118502 · flutter/flutter

Steps to Reproduce flutter doctor -v [!] Android Studio (version 2022.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetb...

github.com

 

반응형

댓글