skip to Main Content
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


  1. 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:

    1. 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.

    2. 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:

      • Open the Control Panel on your computer.
      • Search for "Environment Variables" and open the corresponding settings.
      • In the System Properties window, click on the "Environment Variables" button.
      • Under the "System variables" section, click on "New".
      • Enter JAVA_HOME as the variable name.
      • Provide the path to your JDK installation as the variable value. For example, it might be C:Program FilesJavajdk1.8.0_291.
      • Click "OK" to save the changes.
    3. To ensure that the updated JAVA_HOME variable takes effect, close any open command prompt or terminal windows and reopen them.

    4. 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.

    5. 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.

    6. Update the PATH environment variable to include the path to the Android SDK tools. Follow these steps:

      • Use the steps mentioned in the previous solution to open the Environment Variables window.
      • Under the "System variables" section, find and select the "Path" variable, then click on "Edit".
      • Add a new entry that corresponds to the path of the platform-tools directory within your Android SDK installation. For example, it might be C:UsersYOUR_USERNAMEAppDataLocalAndroidsdkplatform-tools.
      • Click "OK" to save the changes.
    7. 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.

    Login or Signup to reply.
  2. I am also getting the same error, have you resolved the error?
    can you please help?

    Login or Signup to reply.
  3. 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 .

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search