skip to Main Content

the problem with android licenses
and when i tried fixing it the problem was in java

when I typed flutter doctor

[√] Flutter (Channel stable, 3.7.1, on Microsoft Windows [Version 10.0.22621.1105], locale en-US)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.3.6)
[√] Android Studio (version 2022.1)
[√] VS Code (version 1.75.0)
[√] Connected device (3 available)
[√] HTTP Host Availability

! Doctor found issues in 1 category.

and when I typed
flutter doctor --android-licenses
this error appears
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main"
so can someone help:face_with_monocle: note :the java and javac on my pc are the same version

3

Answers


  1. run this command in the command prompt

    flutter doctor --android-licenses
    

    and type y and enter when you are asked.
    and as you mentioned you are getting error here is the solution for your error that is given at another question https://stackoverflow.com/a/31523756/14466860 check out this

    Login or Signup to reply.
  2. I started noticing these errors after upgrading to macOS 13. However I suspect they started after I upgraded to Android Studio Electric Eel (2022.1).

    flutter doctor was reporting the following:

    Doctor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel flutter-3.2-candidate.5, 3.3.3-0.0.pre.2, on macOS 13.2.1 22D68 darwin-x64, locale en-US)
    [!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
        ✗ 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.
    [✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    [✓] Chrome - develop for the web
    [!] Android Studio (version 2022.1)
        ✗ Unable to find bundled Java version.
    [✓] VS Code (version 1.69.2)
    [✓] Connected device (3 available)
    [✓] HTTP Host Availability
    

    I symlinked the jbr director to jre according to this answer. This resolved both complaints. No other action was required.

    Login or Signup to reply.
  3. For me the solution working downloading latest version of java and update path to new jdk

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