1. Open the terminal
2.clone flutter
command:
git clone -b beta https://github.com/flutter/flutter.git
Step this given terminal:
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
Solution look at this one: git clone error: error: RPC failed; curl 18 transfer closed with outstanding read data remaining solution
3. Open (or create) .bash_profile
1. Open
Input Terminal:
open -e .bash_profile
If you can not successfully opened, it created
2. Create
1. Enter the current user's home directory (the default is)
cd ~
or
cd /Users/用户名
4. Update the environment variables
Open bash_profile is to be permanently updated environment variables, once and for all. See the explanation and attention to their own needs to add code to the open bash_profile.
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
Explanation: Since some flutter
commands need to get data networking, if you are in-country visit, due to reasons known, direct access to it may not be successful. The above PUB_HOSTED_URL
and FLUTTER_STORAGE_BASE_URL
is google for domestic developers to build temporary image. You can not set up, if you can, then over the wall. If not, then you can directly copy the code above
export PATH= PATH_TO_FLUTTER_GIT_DIRECTORY/flutter/bin:$PATH
Note : PATH_TO_FLUTTER_GIT_DIRECTORY
the path you flutter, as in the current path in user. If you are unsure, you can click mac menu above the "Go" -> "Personal", then this folder to find whether there flutter folder. If any of you should write:
export PATH= /Users/用户名/flutter/bin:$PATH
Then enter the following command to update the environment variables you just configured:
source .bash_profile
Then enter the following command, by running the flutter/bin
command to verify whether the directory has been in the PATH:
echo $PATH
If you see that there is a good distribution flutter
5. Run flutter doctor
Enter the following command to install point of view there are no dependencies:
flutter doctor
I say this is a start
Tip flutter version is too low
Let me update flutter, so I do not want to see the warning immediately updated.
flutter upgrade
Error 1:
And then look at x, and this is my first crossed a place
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.io/setup/#android-setup for detailed instructions).
If Android SDK has been installed to a custom location, set $ANDROID_HOME to that location.
Way, I am installing android studio and set the environment variable $ ANDROID_HOME.
I then follow the prompts to open https://developer.android.com/studio/index.html , and download and install android studio.
After installation run the best android studio, good installation andriod sdk. According to the interface for operation next point, if there is no sdk will be prompted to install, as long as the point on the line. Remember to view the installation path, the path is usually in the current user's Library folder.
After installing the sdk, android studio can be put off.
Then open bash_profile
open -e .bash_profile
In bash_profile years plus
export ANDROID_HOME="/Users/用户名/Library/Android/sdk" //android sdk目录,替换为你自己的
export PATH=${PATH}:${ANDROID_HOME}/tools
export PATH=${PATH}:${ANDROID_HOME}/platform-tools
Update Configuration
source .bash_profile
Then run
flutter doctor
See also this one is not an error. ok there are still error, given as follows:
[!] Android toolchain - develop for Android devices (Android SDK 28.0.2)
✗ Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
Follow the prompts to run:
flutter doctor --android-licenses
Then follow the prompts have been y, y to the end.
Error 2:
This is my second place crossed
[!] iOS toolchain - develop for iOS devices
✗ Xcode installation is incomplete; a full installation is necessary for iOS 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.app/Contents/Developer
✗ libimobiledevice and ideviceinstaller are not installed. To install, run:
brew install --HEAD libimobiledevice
brew install ideviceinstaller
✗ ios-deploy not installed. To install:
brew install ios-deploy
✗ 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 setup
Follow the prompts to install the App Store xcode.
After installation run before the error message:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
then:
brew install --HEAD libimobiledevice
Unable to install on mac * libimobiledevice *, throws the following exception:
checking for openssl >= 0.9.8... no
configure: error: OpenSSL support explicitly requested but OpenSSL could not be found
READ THIS: https://docs.brew.sh/Troubleshooting
Tried many gestures will not work, I finally found a way:
brew install gnutls
brew install libgcrypt
./autogen.sh --disable-openssl
make
make install
Author: JarvanMo
link: https: //www.jianshu.com/p/9194cf450ff0
Source: Jane book
Jane book copyright reserved by the authors, are reproduced in any form, please contact the author to obtain authorization and indicate the source.
And then:
brew install ideviceinstaller
And then:
brew install ios-deploy
Then also:
brew install cocoapods
Finally, then:
pod setup
I carried it to the error:
[!] /usr/bin/git clone https://github.com/CocoaPods/Specs.git master --progress
Cloning into 'master'...
remote: Counting objects: 2353094, done.
remote: Compressing objects: 100% (450/450), 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
Get hold of accelerators on it. I use the cloud wall netfits, there is a trial, a trial download enough. If there is a better accelerator welcome message.
Then run doctor
flutter doctor
ios also given:
[!] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
✗ Missing Xcode dependency: Python module "six".
Install via 'pip install six' or 'sudo easy_install six'.
Prompted to enter 'pip install six' or 'sudo easy_install six'. And then run the doctor, I am not being given the ios here. 3 got left error in the error.
Error 3:
[✓] Android Studio (version 3.1)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
android studio was short of two plug-ins. We open andriod studio.
1. Click on preferences
image
2. Search plugins
image
3. Search flutter
image-20180813214903100
4. Click Install
When the execution brew install --HEAD libimobiledevice
time will encounter a problem:
brew install --HEAD libimobiledevice
==> Cloning [https://git.libimobiledevice.org/libimobiledevice.git](https://git.libimobiledevice.org/libimobiledevice.git) Updating /Users/rjoiner/Library/Caches/Homebrew/libimobiledevice--git
==> Checking out branch master Already on 'master' Your branch is up to date with 'origin/master'. HEAD is now at b34e343 tools: Remove length check on device UDID arguments to support newer devices
==> ./autogen.sh Last 15 lines from /Users/rjoiner/Library/Logs/Homebrew/libimobiledevice/01.autogen.sh: checking dynamic linker characteristics... darwin16.7.0 dyld checking how to hardcode library paths into programs... immediate checking for pkg-config... /usr/local/opt/pkg-config/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes checking for libusbmuxd >= 1.1.0... no configure: error: Package requirements (libusbmuxd >= 1.1.0) were not met:
Requested 'libusbmuxd >= 1.1.0' but version of libusbmuxd is 1.0.10
Simply black question mark ah, so a lot of information output. But take a closer look at the last line, we will find anomalies where Requested 'libusbmuxd >= 1.1.0' but version of libusbmuxd is 1.0.10
, apparently due to inconsistencies * libusbmuxd * version and the version you want to install the system requirements.
After some searching finally found the problem:
A recent change to
libimobiledevice
bumped the constraint on libusbmuxd to >= version 1.1.0. The currentusbmuxd
homebrew package is version 1.0.10.
As a result, homebrew--HEAD
installs of libimobiledevice no longer build without a--HEAD
install ofusbmuxd
.
Until theusbmuxd
homebrew formula is updated, a workaround is to install it at HEAD:
总之就是libimobiledevice更新了,我们可以通过下面的方式安装libimobiledevice:
brew update
brew uninstall --ignore-dependencies libimobiledevice
brew uninstall --ignore-dependencies usbmuxd
brew install --HEAD usbmuxd
brew unlink usbmuxd
brew link usbmuxd
brew install --HEAD libimobiledevice