Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this sourc

flutter doctor 执行 报错

Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.3.10, on Microsoft Windows [版本 10.0.19044.2846], locale zh-CN)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    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.
[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 4.2)
[√] Connected device (2 available)
[√] HTTP Host Availability

2.执行 flutter doctor --android-licenses 报错

Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
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

废话不多,原因:

当前使用的jdk版本太低,博主第一次使用的是jdk1.8,之后换成11.0.1 ,解决了问题

 备注:更换完jdk以后,一定要记得,as、环境变量配置里面都要改哦(详细的就不多说了,毕竟大家都知道bd的,*-*)

你可能感兴趣的:(错误集锦,Flutter学习错误集锦,flutter,android,android,studio)