https://book.flutterchina.club/chapter1/dart.html
https://flutterchina.club/widgets-intro/
https://www.cnblogs.com/zhangrunhao/p/9970656.html
https://www.jianshu.com/p/eb782589be82
文章目录
0.当运行flutter doctor报错
0.问题:[!] Xcode - develop for iOS and macOS (Xcode 11.3.1)
✗ CocoaPods installed but not working.
You appear to have CocoaPods installed but it is not working.
This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to
invoke it.
This can usually be fixed by re-installing CocoaPods. For more info, see
https://github.com/flutter/flutter/issues/14293.
To re-install CocoaPods, run:
sudo gem install cocoapods
解答:当执行 sudo gem install cocoapods 无效是 或者提示没有权限的时候 执行
sudo gem install -n /usr/local/bin cocoapods
1.问题: ✗ Android license status unknown.
解答:打开“Android studio”,点“Configure”选择“SDK Manager ” -> android sdk -> sdk tools 然后把右下角的 hiden obsolete package 前边的对号点掉 然后上边的列表就多出了一个 Android sdk tools obsolete 然后点击前边的勾选 然后下载就行了 终端执行 flutter doctor --android-licenses
一直y下去
1.当运行flutter run是报错Exception: idevice_id returned an error: 可以执行下边命令
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
brew install ideviceinstaller
2.configure: error: Package requirements (libusbmuxd >= 1.1.0) were not met:
作为一个同时开发Android和iOS的人,我本地AndroidStudio和Xcode都安装了最新版。解压完zip包并且配置完环境变量之后运行flutter docker会提示安装brew install --HEAD libimobiledevice,直接运行这句命令会抛出以下异常:
configure: error: Package requirements (libusbmuxd >= 1.1.0) were not met:
Requested ‘libusbmuxd >= 1.1.0’ but version of libusbmuxd is 1.0.10
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables libusbmuxd_CFLAGS
and libusbmuxd_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
READ THIS: https://docs.brew.sh/Troubleshooting
这时候需要运行brew unlink usbmuxd & brew install --HEAD usbmuxd而不是libusbmuxd。
另外建议不用先按照flutter docker返回的提示安装,可