개발하자

M1 Apple Silicon에서 Android 스튜디오 Arctic Fox(2020.3.1)를 업데이트한 후 플러터 닥터가 포함된 번들 Java 버전을 찾을 수 없습니다

Cuire 2023. 2. 1. 23:05
반응형

M1 Apple Silicon에서 Android 스튜디오 Arctic Fox(2020.3.1)를 업데이트한 후 플러터 닥터가 포함된 번들 Java 버전을 찾을 수 없습니다

저는 이상한 문제에 직면해 있습니다. Android Studio를 업데이트하기 전에는 모든 것이 잘 진행되었습니다. Android Studio를 업데이트하면, Doctor를 실행하면 "Unable to find bundled Java version"으로 표시됩니다. 이미 Java 설치 프로그램을 다운로드하여 M1 Mac에 설치했지만 다시 시작한 후에도 Flotter Doctor를 실행하면 동일한 오류가 표시됩니다. 이상한 것은 북극 폭스 버전을 제거하고 이전 안드로이드 스튜디오 버전을 다시 설치하면 닥터를 실행할 때 모든 것이 다시 잘 된다는 것이다. 이 문제를 해결하려면 어떻게 해야 합니까?




업데이트 대상:

안드로이드 에스투디오 2022.1 전기뱀장어+자바19+VS코드+윈도10x64

올바른지 확인하십시오

1 - [, 왜냐하면 오직 ]을 위해 일하기 때문이다

2- the

3- 명령 및 문제가 해결되었지만 라이센스 문제가 나타납니다

4- 명령 대기 및 모두 수락

다른 방법은 작동하지 않습니다. 오류를 던졌습니다. "빌어먹을..." 왜죠?

명령의 구조가 다음과 같기 때문이다:

"이름이 있는 곳"이라는 기호 링크를 "이름이 있는 곳"이라는 폴더로 만듭니다

파일 경로에 "큰따옴표"를 사용하고 "말하기"와 "말하기"를 사용해야 합니다(cmd에서 서두르는 냄새가 납니다).

만약 당신이 이렇게 하지 않는다면, 새로운 안드로이드 에스투디오가 사용하지 않고 많은 안드로이드 기기들이 실행되지 않는 이유로, 그리고 그것은 장치들을 실행하는 데 문제가 생길 것이다.




Android Studio Electric Eel | 2022.1.1을 사용하는 경우.

온맥

  1. 파인더에서 "응용프로그램"을 엽니다. 그런 다음 Android Studio를 마우스 오른쪽 단추로 클릭하고 "패키지 내용 표시"를 선택합니다.
  2. 그 안에서 "내용" 폴더를 엽니다. 그 안에 이름이 "jbr"인 폴더가 보일 것이다.
  3. jbr 폴더를 복제하기만 하면 됩니다. 그런 다음 복사 폴더의 이름을 "jre"로 변경합니다.
  4. 그러면 펄럭이는 의사 선생님. 번들 Java 버전을 찾을 수 없음 경고가 사라집니다.

대체 방법을 제공해 준 @Javi에게 감사드립니다. 2단계와 3단계의 경우에도 작업을 완료할 수 있습니다. 그리고 저는 이것이 가장 좋은 방법이라고 생각합니다.




이것이 Windows(윈도우) 수정 사항이며, 저에게 효과가 있는 것 같습니다. Android Studio 2022.1.1.19를 사용하고 있습니다

  1. 먼저 Android Studio 아이콘을 마우스 오른쪽 버튼으로 클릭하고 파일 디렉토리(위치)를 엽니다. 설치 폴더는 "C:"에 있어야 합니다:\프로그램 파일\Android\Android Studio".
  2. Android Studio 설치 루트 폴더에 이미 있는 경우 두 개의 폴더가 표시됩니다: " 및 "
  3. "" 폴더에 있는 모든 파일을 "" 폴더에 복사한 다음 다시 시도하십시오.

참고: 이 수정 사항은 내 쪽에서 효과가 있습니다. 만약 당신 쪽에서 효과가 없다면 아래에 설명하십시오.




@crzorz의 추가 답변이 나에게 효과가 있었다. "YOUR_PATH/flutter/packages/flutter_tools/lib/src/android/android_studio.dart"입니다. 파일 하단에는 @crzorz가 언급한 "globals.fs.path.join(디렉토리, 'jre', 'jdk', 'Contents', 'Home')"과 유사한 행이 표시됩니다.

이 선들은 MacOS (구 버전과 새로운 버전)와 다른 OS에서 "flutter doctor"가 소위 번들 자바를 어떻게 찾는지를 명확하게 보여준다.

저는 안드로이드 스튜디오 일렉트릭 장어를 사용합니다. 내가 이 문제를 해결하기 위해 한 일은 "jbr을 가리키는 jre라는 이름의 심볼릭 링크를 만드는 것"이었다. jbr 폴더(JetBean Runtime)는 java.exe와 다른 자바 런타임 파일을 가지고 있지만 flotdoctor는 여전히 jre라는 이름의 폴더를 찾으려고 하기 때문이다.




In my case, on a macOS Ventura with Intel processor, I had to follow the steps below in order to make Flutter work after upgrading Android Studio to Electric Eel:

  1. cd /Applications/Android\ Studio.app/Contents/
  2. ln -s jbr jre
  3. flutter config --android-studio-dir /Applications/Android\ Studio.app/Contents

Step 3 was important, without it flutter doctor --android-licenses <would always fail...




COPY folder /Applications/Android Studio Preview.app/Contents/jre/Contents to /Applications/Android Studio Preview.app/Contents/jre/jdk/Contents




The answer is already posted here.

For Mac User:

Set Java_Home path using below article & then after applying this command.

after that type below command in terminal:

cd /Applications/Android\ Studio.app/Contents/jre

ln -s ../jre jdk

ln -s "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" jdk

flutter doctor -v



Here is a little fuller answer for everything I had to do to get Android Studio set up on my M1.

  1. Install Android Studio to the Applications folder

  2. Create a symbolic link to from the jre folder to a new jdk folder. (Due to this bug)

cd /Applications/Android\ Studio.app/Contents/jre
ln -s ../jre jdk
  1. Set the JAVA_HOME environment variable
nano ~/.zshrc
export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home"
source ~/.zshrc
  1. Install Android SDK Command-line Tools (needed for accepting license)

  2. At this point it should work now (assuming you've also added flutter to your path)

flutter doctor



I did install a fresh version of JAVA SDK, flutter, Android Studio and run the below command directly on the terminal one by one to fix 'Unable to find bundled Java version. ' issue.

  1. cd /Applications/Android\ Studio.app/Contents/jre

  2. ln -s ../jre jdk

  3. ln -s "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" jdk

  4. flutter doctor -v

Now, you should be able to see the error is disappeared in flutter doctor description in terminal.




Perhaps the simplest option (MAC):

  • Navigate to: cd /Applications/Android\ Studio.app/Contents/jre
  • Create a directory: mkdir jdk
  • Create a soft link: ln -s Contents jdk/Contents



I had the same error after updating Android Studio to 2020.3.1 Patch 3 (on MAC).

After upgrading Flutter from 2.2.2 to 2.5.3 problem was solved.

I also installed "Android SDK Command-line Tools". It's installation is explained here: https://stackoverflow.com/a/68492909/6839552




Run Flutter doctor, if there´s an error indicating that the java bundled can´t be found (specially if you have Android Studio version Artic Fox), run this commands if using Mac:

  1. cd /Applications/Android\ Studio.app/Contents/jre

  2. ln -s ../jre jdk

  3. ln -s "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" jdk

  4. Flutter Doctor




This solution is for M1 Mac User

  1. Find your local Java version by typing /usr/libexec/java_home -V. If didn't exist, install the latest ARM Java version here
  2. Set Java_Home path (in my case jdk-17.0.1.jdk) by typing /usr/libexec/java_home /Library/Java/JavaVirtualMachines/jdk-17.0.1.jdk/Contents/Home
  3. Type all of these in terminal
cd /Applications/Android\ Studio.app/Contents/jre
ln -s ../jre jdk
ln -s "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" jdk
  1. Finally run flutter doctor -v to see all the details changes



The accepted solution worked with a slight modification for me. I had to add the -f (or use --force) option to make it work (this is because ln failed with file exists and I kept ignoring that - the existing file must have had a problem).

cd /Applications/Android\ Studio.app/Contents/jre
ln -s -f ../jre jdk
ln -s -f "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" jdk

flutter doctor -v

I'm running macOS Monterey


반응형