Flutter 3.16.2 最好与 JDK17 配合,不然问题较多。Gradle可以到 7.4
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
配置环境变量JAVA_HOME,PATH.
PS D:\dev\project\temp> flutter doctor -v
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
[√] Flutter (Channel stable, 3.16.2, on Microsoft Windows [版本 10.0.22621.2715], locale zh-CN)
• Flutter version 3.16.2 on channel stable at D:\dev\sdk\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 9e1c857886 (3 days ago), 2023-11-30 11:51:18 -0600
• Engine revision cf7a9d0800
• Dart version 3.2.2
• DevTools version 2.28.3
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
• Android SDK at D:\Android\android-sdk
• Platform android-33, build-tools 33.0.1
• ANDROID_SDK_ROOT = D:\Android\android-sdk
• Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.4.4)
• Visual Studio at d:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.4.33213.308
• Windows 10 SDK version 10.0.22000.0
[√] Android Studio (version 2022.3)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
[√] VS Code, 64-bit edition (version 1.84.2)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 3.78.0
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [版本 10.0.22621.2715]
• Chrome (web) • chrome • web-javascript • Google Chrome 119.0.6045.200
• Edge (web) • edge • web-javascript • Microsoft Edge 119.0.2151.93
[!] Network resources
X An HTTP error occurred while checking "https://github.com/": 信号灯超时时间已到
! Doctor found issues in 1 category.
插件开发工程建立命令
flutter create --org com.91egg --template=plugin --platforms=android,ios,windows,web,linux,macos -a java -i objc filepath_selecter
工程建好后,修改一下example/android下面的gradle的url.
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
试了3685次才成功编译。。。
windows
android