background
In the increasingly involved development circle, one more skill means an improvement in competitiveness, which is subject to various factors in the general environment, so this article is written.
theme
The topic of this article is to introduce how to configure flutter
current environment
win10
as2022.1.1 version
jdk11
Configuration process
Download flutter sdk
First, download a flutter sdk from the official website, download address
The current version used by the blogger is –flutter_windows_3.7.8-stable
Configure flutter sdk environment
(1) After downloading the sdk, unzip it, enter the bin directory, copy the full path, open the system environment variables page, in the Path column (if not, create a new one), add the full path just copied, click save (2) Pass the
command
flutter config --android-studio-dir <directory>
Configure the directory of androidstudio
(3) configure the local sdk path through instructions
flutter config --android-sdk xxxx
(4) Configure the flutter image
(4-1)
Open the 'packages/flutter_tools/lib/src/http_host_validator.dart' file under the flutter sdk folder and change https://maven.google.com/ to https://dl.google.com/ dl/android/maven2/
(4-2)
Delete the fluuter/bin/cache/flutter_tools.snapshot file
(4-3)
In the environment variable Path, add the following value
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
(5) Download the complete androidstudio sdk cmd tools. Open the sdk manager interface, click the Sdk Tools column, select Android SDK Command-line Tools to download and save.
Open androidstudio, install the flutter plug-in, and restart as
Execute dos command
Through the cmd command, enter:
flutter doctor --android-licenses
flutter doctor
.
The above process has solved most of the environment configuration problems. If you have other questions, you can search for information or leave a message.
that’s all----------------------------------------------------------------------------------