I am facing error while installing flutter, can any one help me with this.
while using flutter doctor --android-licenses
I facing error like java.lang.UnsupportedClassVersionError
A JNI error has occurred, please check your installation and try again
Android sdkmanager tool was found, but failed to run (C:UsersMahendra KoppulaAppDataLocalAndroidsdkcmdline-toolslatestbinsdkmanager.bat): "exited code 1".
Try re-installing or updating your Android SDK,
(https://phpout.com/wp-content/uploads/2023/06/fLxX8-jpg.webp)
3
Answers
The error you’re facing suggests that there is a problem with the compatibility between the Java version and the Android SDK version you’re using. To resolve this issue, you can follow these steps:
First, make sure you have the latest version of the Java Development Kit (JDK) installed on your computer. You can download it from the Oracle website by visiting this link: Oracle JDK Downloads.
After installing the JDK, you need to set up an environment variable called
JAVA_HOME
. This variable tells your system where the JDK is located. Here’s how you can set it up:JAVA_HOME
as the variable name.C:Program FilesJavajdk1.8.0_291
.To ensure that the updated
JAVA_HOME
variable takes effect, close any open command prompt or terminal windows and reopen them.Now, try running the command
flutter doctor --android-licenses
again to check if the issue still persists. If you continue to encounter the same error, proceed to the next step.Confirm that you have the latest version of the Android SDK installed. You can download the SDK command-line tools from the Android Developers website. Visit Android Studio Downloads to obtain the SDK. Install it and ensure that it is properly configured.
Update the
PATH
environment variable to include the path to the Android SDK tools. Follow these steps:platform-tools
directory within your Android SDK installation. For example, it might beC:UsersYOUR_USERNAMEAppDataLocalAndroidsdkplatform-tools
.Finally, restart your command prompt or terminal, and attempt to run
flutter doctor --android-licenses
once more.If you’re still encountering the same error after following these steps, please provide additional details about the error message or any other relevant information, and I’ll do my best to assist you further.
I am also getting the same error, have you resolved the error?
can you please help?
This issue occurs due to Java version. Install latest version of Java at your system and then set the java path at your system. then try to accept the android licenses .