The subject catalog of Flutter: this catalog helps you quickly find out what you want to learn!!

In this chapter we will quickly build the development environment of the Flutter and share some tips and experiences in building the development environment. Just read my post! 😊 😊 😊

If you are building the development environment of The Flutter, please leave a comment in the comments section and I will try to contact you at 📮 as soon as possible

1. Playing Flutter on Android

1. Download and install Android Studio

Might be a bit faster the download address: developer. The android, Google. Cn/studio

2: About Android Studio configuration

Here is a very, very detailed configuration document:

www.cnblogs.com/mengtaoadmi…

If you need additional configuration or have questions, you can go to the Android website to consult and communicate

Developer. The android. Google. Cn/studio/intr…

OK, here we temporarily configure the Android environment! Next go to install the Flutter

4: Check HomeBrew (this is very handy)

We need to check that HomeBrew is up to date before we go to configure our Flutter environment! If not, go to the HomeBrew website and download it

5: Download the Flutter SDK

Official WEBSITE SDK download address speed is very fast! Of course, you can also go to 👇 to clone

git clone -b beta https://github.com/flutter/flutter.git
Copy the code

Here I see the official website download speed is very fast, on their own download decompression, there are a lot of people on the Internet said that the clone is quite time. Since quick learning does not go to unnecessary mining pits 😄

Then extract the file to the desired location

Because the SDK for Flutter includes many command-line tools. We need to configure environment variables, so we recommend you install them where you normally put your command-line tools! I installed in the root directory of opt!

/opt/flutter (fYI, install where to see your own habits)

5: configure environment variables

When Flutter is running, you need to go to the official download of the required resources. If you don’t have a “ladder”, you will need a mirror server. Here is the official document.

  • Go to the configuration file of your corresponding Shell and configure.

  • If you are using the default bash then configure ~/.bash_profile

  • If you are using ZSH (the default is ZSH on new Mac systems) then configure ~/.zshrc

#Flutter mirror configuration
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https:// story.flutter -io.cn # flutter configuration export flutter =/opt/flutter/bin
export PATH=$FLUTTER:$PATH
Copy the code

Execute source ~/.bash_profile when the configuration is complete

So next! We can see if the Flutter is configured. The Flutter has a doctor detection command. Designed to detect your Flutter environment.

flutter doctor
Copy the code

After running for a while you can get the case of 👇, which is not successfully configured on Android and VS Code

Next we will configure the Flutter environment for each platform to solve the following problems

[!] Those who qualify can qualify onto Android devices (Android SDK version 30.0.3). Those who qualify can qualify onto Android licenses resolve this, run: flutter doctor --android-licenses [!] Those who qualify onto University can qualify onto Android Studio (version 4.1). Those who qualify can go onto university. Those who qualify can go onto university. this adds Dart specific functionality. [!] VS Code (version 1.52.0) Those who qualify onto university can not be installed. install from https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter [!]  Connected device ! Error: Cooci's iPhone is not connected. Xcode will continue when Cooci's iPhone is connected. (code-13)Copy the code

6: Configure each platform environment

Solve the problem of Android-licenses

Flutter doctor -- Android-LicensesCopy the code

Install the Flutter plugin on Android -> configure -> Plugins

Note that there is a bug in version 4.1.1 that is implied by the addition of plugins. You can lower the version

Because the location of the plugins in Android Studio 4.1 has changed, the command flutter Doctor will still look for the two plugins in the original location, so the plugins cannot be found.

But does not affect the package compilation!!


Updated 21 December 2020

About: Android Studio (Version 4.1); Flutter plugin not installed and Dart plugin not installed

One of my students offered a solution: the original address: AndyGF

Android Studio (4.1) has both the Flutter and Dart plug-ins installed. The flutter Doctor command fails to detect the two plug-ins.

The reason is that Android Studio (4.1) has changed the location of the plugins and the command Flutter Doctor will still look for the plugins in their original location.

Old directory: ~/Library/Application/Support/AndroidStudio4.1

A new directory: ~ / Library/Application/Support/Google/AndroidStudio4.1 / plugins

The solution is to soft link:

ln -s ~/Library/Application\ Support/Google/AndroidStudio4.1/plugins ~/Library/Application\ Support/AndroidStudio4.1
Copy the code

😄 very comfortable solution! Look at a row of green I also feel at ease!! Thank you again for [AndyGF] (www.jianshu.com/p/58fdbc82a.) Provide advice, you may wish to take a look at his article, in the brief book above this article has: more than 800 page views estimate you will also meet! At the same time, welcome everyone who is willing to refueling for iOS ecology, you can leave a message and communicate with private message in time if you encounter any problems

Updated 21 December 2020


Updated 30 December 2020

Those who qualify can qualify onto Android Toolchain-DevelopforThose who qualify can't locate Android SDK. Install Android Studiofrom:
      https://developer.android.com/studio/index.html On first launch it will assist you in installing the Android SDK components. (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions). If the Android SDK has been installed to a custom location, set ANDROID_SDK_ROOT to that location. You may also want to add it to your PATH environment variable.Copy the code

The solution is as follows: Open Android Studio-> click Configure-> SDK Manager

Find the Android SDK Location and copy the above Location to /Users/ your user name /Library/Android/ SDK

Then go to the terminal and type the command flutter config –android-sdk /Users/ your username /Library/Android/ SDK

Execute the flutter doctor again, problem solved!


Install the flutter plugin in VSCode

â‘£ : The real device reports an error

[!]  Connected device !Error:The iPhone is Coocinot connected. Xcode will continue whenCooci's iPhone is connected. (code -13) 
Copy the code

This problem can be solved as long as connected to the real machine!

With the problem solved, you can open the classic Flutter interface and start playing!

Other ways to play Flutter

There are a few things that you rely on in the iOS environment

Environments and tools for deploying the Flutter application to iOS devices need to be installed via Homebrew:

brew install --HEAD libimobiledevice
brew install ideviceinstaller ios-deploy cocoapods
Copy the code

There are many different situations in different situations, and if you are not successful you can use the Flutter doctor to locate the problem

  • 1. Command line
# Where flutterApp is the project name, cannot use uppercase
flutter create flutterapp

cd flutterapp
flutter run 
Of course, if you connect to the real machine - it can still run on the real machine

flutter run -d 47662d3bad7fa0da458.....
Copy the code

2. Run XCode

All roads to Rome flutter is quite convenient!

Dry goods address: like can be a key three