返回顶部
首页 > 资讯 > 移动开发 >安装flutter时遇到:has been compiled by a more recent version of the Java Runtime (class file version 55.0
  • 601
分享到

安装flutter时遇到:has been compiled by a more recent version of the Java Runtime (class file version 55.0

flutterandroid 2023-09-03 07:09:45 601人浏览 独家记忆
摘要

这个问题困扰了我一天   当我试着跟着内容提示进行授权认证时  ✗ Android license status unknown.       Run `flutter doctor --android-licenses` to accep

这个问题困扰了我一天  

当我试着跟着内容提示进行授权认证时 

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

当我输入了这 'flutter doctor --android-licenses' 时 遇到报错

yangjie@yangdeMBP ~ % Flutter doctor --Android-licensesError: A JNI error has occurred, please check your installation and try againException in thread "main" java.lang.UnsupportedClassVersionError: com/android/prefs/AndroidLocationsProvider has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0at java.lang.ClassLoader.defineClass1(Native Method)at java.lang.ClassLoader.defineClass(ClassLoader.java:757)at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)at java.net.URLClassLoader.access$100(URLClassLoader.java:74)at java.net.URLClassLoader$1.run(URLClassLoader.java:369)at java.net.URLClassLoader$1.run(URLClassLoader.java:363)at java.security.AccessController.doPrivileged(Native Method)at java.net.URLClassLoader.findClass(URLClassLoader.java:362)at java.lang.ClassLoader.loadClass(ClassLoader.java:419)at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)at java.lang.ClassLoader.loadClass(ClassLoader.java:352)at java.lang.Class.getDeclaredMethods0(Native Method)at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)at java.lang.Class.privateGetMethodRecursive(Class.java:3048)at java.lang.Class.getMethod0(Class.java:3018)at java.lang.Class.getMethod(Class.java:1784)at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:650)at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:632)

解决:检查你在计算机上安装的 java 版本。如果是版本 8,则安装 Android SDK 命令行工具 8.0 并卸载最新版本。

然后重新在"flutter doctor --android-licenses"  就可以愉快的yes啦!

 

来源地址:https://blog.csdn.net/m0_55584658/article/details/129184183

--结束END--

本文标题: 安装flutter时遇到:has been compiled by a more recent version of the Java Runtime (class file version 55.0

本文链接: https://lsjlt.com/news/391790.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作