這個(gè)問(wèn)題困擾了我一天??
當(dāng)我試著跟著內(nèi)容提示進(jìn)行授權(quán)認(rèn)證時(shí)?
? 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
當(dāng)我輸入了這 'flutter doctor --android-licenses' 時(shí) 遇到報(bào)錯(cuò)
yangjie@yangdeMBP ~ % flutter doctor --android-licenses
Error: A JNI error has occurred, please check your installation and try again
Exception 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.0
at 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)
解決:檢查你在計(jì)算機(jī)上安裝的 java 版本。如果是版本 8,則安裝 Android SDK 命令行工具 8.0 并卸載最新版本。
然后重新在"flutter doctor --android-licenses"? 就可以愉快的yes啦!
文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-564776.html
?文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-564776.html
到了這里,關(guān)于安裝flutter時(shí)遇到:has been compiled by a more recent version of the Java Runtime (class file version 55.0的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!