1

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

  • You have not accepted the licenses , may be launch it once in Android Studio and accept the license ( this is what i do ) and it will be all good. – Ahmad Feb 05 '23 at 19:50

3 Answers3

0

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

Munsif Ali
  • 1,839
  • 1
  • 8
  • 22
0

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.

trukvl
  • 936
  • 7
  • 16
0

For me the solution working downloading latest version of java and update path to new jdk