1. problem: android studio prompts Unable to find bundled Java version
[!] Android Studio (version 2020.3)
• Android Studio at /Applications/Android Studio Preview.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
✗ Unable to find bundled Java version.
• Try updating or re-installing Android Studio.
Treatment method:
cd /Applications/Android\ Studio.app/Contents/jre
ln -s ../jre jdk
ln -s "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" jdk
Perfect result:
[✓] Android Studio (version 2020.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
2 questions
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
Terminal input: Shuttle doctor — Android licenses. The following error is reported
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 5 more
Treatment method
one Update the SDK manager in the tools/bin directory of the Android SDK
Terminal input:/users/* * */tools/bin/sdkmanager — update
2. Configure Java_ HOME
JDK under MAC is installed under /library/Java/javavirtualmachines
by default. The real path is shown in the figure below:
WJdeMacBook-Pro:~ wj$ cd /Library/Java/JavaVirtualMachines
WJdeMacBook-Pro:JavaVirtualMachines wj$ ls -la
total 0
drwxr-xr-x 3 root wheel 96 3 21 15:25 .
drwxr-xr-x 4 root wheel 128 1 1 2020 ..
drwxr-xr-x 3 root wheel 96 4 3 2019 jdk1.8.0_77.jdk
Refer to Apple’s documentation for the command/usr/libexec/Java_ Use the – V option after home to list all versions of Java_ Home, i.e. the following results:
WJdeMacBook-Pro:JavaVirtualMachines wj$ /usr/libexec/java_home -V
Matching Java Virtual Machines (2):
1.8.77.03 (x86_64) "Oracle Corporation" - "Java" /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
1.8.0_77 (x86_64) "Oracle Corporation" - "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
Select the JDK version you need and configure it to. Bash_ In profile
Terminal input:
one open .bash_ profile
two export JAVA_ HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_ 212.jdk/Contents/Home
export PATH=$JAVA_ HOME/bin:$PATH
three The above 2 configuration paths are copied with. Bash_ In profile file
four After saving, in order for the configuration to take effect immediately, you need to execute: source ~ /. Bash_ Profile command
Input: fluent doctor at the terminal again
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
! Some Android licenses not accepted. To resolve this, run: flutter doctor
--android-licenses
Terminal input: fluent doctor — Android liceses
Multiple occurrences: review licenses that have not been accepted (Y/N)? All input: y and then press enter
Perfect result:
WJdeMacBook-Pro:~ wj$ flutter doctor
***
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
***
Read More:
- flutter, Unable to buy item, Error response code: 7 & flutter_inapp_purchase
- [Solved] Flutter compile error: Failed to find Build Tools revision 29.0.2
- Flutter flutter doctor –android-licenses [How to Solve]
- [Solved] Flutter package flutter build apk Error: permission-handle
- [Solved] java.lang.reflect.InaccessibleObjectException: Unable to make protected java.net.http.HttpRequest()…
- [Solved] ERROR: Unable to find the development tool `cc`
- [How to Fix]Unable to find the requested Boost libraries
- How to Solve Project Upgrade to flutter2.5.0 Error
- [Solved] Windows startup error: unable to find launcherrsxruntime.exe
- [Solved] Android Studio Compile Error: Could not determine java version from ‘11.0.8‘.
- [Solved] Flutter Amap plug-in amap_location error: AmapLocationPlugin.java:287: error
- Flutter android studio runs gradle build error: Could not resolve all artifacts for configuration’:classpath’.
- [Maven Error] Exception in thread “main” java.lang.UnsupportedClassVersionError: org/apache/maven/cli/MavenCli : Unsupported major.minor version 51.0
- [Solved] Elasticsearch error: cannot downgrade a node from version [7.xx.x] to version [7.xx.x]
- [Solved] Mac Runjmeter WARNING: package sun.awt.X11 not in java.desktop
- The pip installation package under Windows reports an error: Microsoft Visual C++ 9.0 is required Unable to find vcvarsall.bat
- [Solved] Cause: java.sql.SQLException: TDengine ERROR (8000000b): Unable to establish connection
- Zchunk error: Unable to find multipart download range error in dnf update
- VSCode Unable to find custom header file directory: fatal error: no such file or directory
- [Easy Solution] flutter Run Error: library “libflutter.so“ not found