Build a Flutter development environment – A Guide to Trampling pits

I believe that many students were disgusted by the environment at the beginning and gave up. Or start complaining about all kinds of pits, unwilling to try again.

Many of you may have read too much about Flutter and want to get started, but most of you have failed to build the environment. It doesn’t matter. Today we will do something different, which will take you from zero to build your Flutter environment.

This article was not necessary, but since the pits are stepped on, convenient for everyone to search for quick positioning problems, we specially recorded all kinds of deep pits, but also for the convenience of everyone to quickly locate and solve the problem, welcome everyone to watch.

Get started: install

  1. Each operating platform needs to download the Flutter

    • A pit

      1. Can’t open it (you get the idea)
      2. Environment configuration
      3. That’s it. What to do
      4. Selection editor
    • Fill in the pit

      1. Science may be needed hereWarning: Chinese developers, please read this article first wikiTo check whether special Settings are required for the network environment.It’s important to note that this is actually where the most people die. The following paragraphs describe the various pits.
      2. The pit here may be the command line environment variable configuration once and for all, Mac example:open .bash_profileStop it.
      3. Create your first Flutter App
      4. Configure Editor will download and install the necessary plug-ins for VS Code.
  2. Install on macOS

    • Dump the official website installation guide macOS
    1. The text begins by telling you some things and commands to use. (The following is the command line operation, follow the tutorial can be knocked)
    2. He suggests you install in ~/development
    3. He suggests that you set the PATH after the download is successful. This field is zero hours. You can try it out and type it directly after CD ~open .bash_profileWhen you open it, take your pieceexport PATH=~/development/flutter/bin:$PATHAdd this one~/development/flutter/binThis paragraph is the real path after you decompress, easy to find, right? Unless you forget where you unzipped to –!
    4. If. Now that you’ve done all of the above, type influtter doctorCheck what you’re missing, and painful install failures beckon… (More on that later)
  3. You need a doctor

    • After the Flutter is downloaded and the environment PATH is set, Doctor, your Flutter needs healing. Then throw out the following physical results:
    • For example:
      Doctor summary (to see all details, run flutter doctor -v):
      [✓] Flutter (Channel beta, v0.5.1, on Mac OS X 10.13.6 17G65, locale zh-Hans-CN)
      [!] Android toolchain - develop forAndroid Devices Qualify Android SDK is missingcommandline tools; download from https://goo.gl/XxQghQ [!]  iOS toolchain - developforIOS Devices Onto university Xcode Installation is incomplete; a full installation is necessaryforiOS development. Download at: https://developer.apple.com/xcode/download/ Or install Xcode via the App Store. Once installed, run: Sudo xcode - select - switch/Applications/xcode. The app/Contents/Developer ✗ ideviceinstaller is not installed. this is used to discover connected iOS devices. To install, run: Brew install --HEAD libiMobileDevice brew install ideviceInstaller onto ios-deploy not installed. To install: Brew install ios-deploy qualify CocoaPods not installed. CocoaPods is used to retrieve the ios platform side's plugin code that responds to your plugin usage on the Dart side. Without resolving iOS dependencies with CocoaPods, plugins will not work on iOS. For more info, see https://flutter.io/platform-plugins To install: brew install cocoapods pod setupCopy the code
      • The good news is that no matter what you encounter, your doctor will tell you how to install it with instructions:
      brew update
      brew install --HEAD libimobiledevice
      brew install ideviceinstaller ios-deploy cocoapods
      pod setup
      Copy the code
      1. You just download it every time the doctor says.
      2. If you think it’s going to be easy, you’re wrong…
  4. Error:

    • Most of the time you will get this error:
    remote: Counting objects: 8152, done.
    remote: Compressing objects: 100% (5441/5441), done.
    error: RPC failed; curl 18 transfer closed with outstanding read data remaining
    fatal: The remote end hung up unexpectedly
    fatal: early EOF
    fatal: index-pack failed
    Error: Failed to download resource "libimobiledevice"
    Failure while executing; `git clone --branch master https://git.libimobiledevice.org/libimobiledevice.git /Users/~/Library/Caches/Homebrew/libimobiledevice--git` exited with 128.
    Copy the code
    • In the heart of ten thousand god beast gushing past. Download 100% done? And report it to me?
    • Discard various searched issues:
      1. error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
      2. error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54 fatal: The remote end hung up unexpectedly fatal: early EOF fatal: index-pack failed
      3. RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
    • Occasionally this happens:
    Updating Homebrew...
    ==> Cloning https://git.libimobiledevice.org/libimobiledevice.git
    Cloning into '/Users/~/Library/Caches/Homebrew/libimobiledevice--git'. remote: Counting objects: 8152, done. remote: Compressing objects: 100% (5441/5441), done. error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54 fatal: The remote end hung up unexpectedly fatal: early EOF fatal: index-pack failed Error: Failed to download resource"libimobiledevice"
    Failure while executing; `git clone --branch master https://git.libimobiledevice.org/libimobiledevice.git /Users/~/Library/Caches/Homebrew/libimobiledevice--git` exited with 128.
    Copy the code
    1. git error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
    2. RPC failed; curl 18 transfer closed with outstanding read data remaining
  5. You need calm down

    • The above mistakes, I do not know that you will encounter, but it is possible to encounter.
    • I am not referring specifically to the dependent code in the above issue, the pull code fails because you may encounter similar problems in different situations.
    • So, the answer may be in the links above, but here are some suggestions for you to try if you encounter similar errors
    git config http.postBuffer 524288000
    git config https.postBuffer 524288000
    Copy the code
    • If you try above method really, still download failure. The final secret, of course, is not, restart the computer, it should beTry a few times more
    • Try a few times more
    • Try a few times more
    • Brew install to pull the Github master more times
    • Why not PIP or Ruby, since there are really no problems with either of them, almost always Brew
    • All said and donebrew install --HEAD libimobiledevice13 times? Still 23 times, and then it worked automatically. ᔪ (⁰ ́ ◊ ⁰ ̀) ᔭ OMG

Finally

  1. The ones mentioned here are only impressive ones, you will find many similar issues in which many people have encountered such problems, but everyone has different solutions. You will notice that some issues are still open and the following are also flooded with replies. So, don’t give up, is the final solution, come on.
  2. Seeing this, reality beat me. The environment alone is exhausting. But, if, this road obstacle you have passed, that behind is not a natural thing! (run
  3. We will continue to update and encourage each other
  4. Guide to Flutter
  5. Because Chinese website