flutter 安装遇到的坑
1.网站和教程
也可以看这个
2.Android studio 找不到 flutter 插件
3.Android SDK file not found
flutter config --android-sdk /Users/sunchengxiu/Library/Android/sdk/
4.Android SDK file not found
打开 Android studio,会提示安装,慢慢等待吧。
5.Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
执行命令:flutter doctor --android-licenses
一直y就行
6. sudo gem install cocoapods
sudo gem install cocoapods
Password:
Fetching: concurrent-ruby-1.1.6.gem (100%)
Successfully installed concurrent-ruby-1.1.6
Fetching: httpclient-2.8.3.gem (100%)
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/bin directory.
➜ ~ sudo gem install cocoapods
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/bin directory.
改为 : sudo gem install -n /usr/local/bin cocoapods
8.Waiting for another flutter command to release the startup lock...
9.Running "flutter pub get" in flutter_app...
10.Error running pod install Error launching application on iPhone 11 Pro Max.
注意:podfile文件中一定要指定master源,因为现在默认是trunk源
source 'https://github.com/CocoaPods/Specs.git'
11.andrio studio 安装 gradle
12.flutter run卡在Running Gradle task 'assembleDebug'...
13.Connect to 127.0.0.1:1087 [/127.0.0.1] failed: Connection refused (Connection refused)
14. android Studio 出现:Unable to resolve dependency for ':app@debug/compileClasspath'
15. flutter Could not build the application for the simulator. Error launching a
先清一下 Xcode 缓存
flutter clean
flutter run
16. 真机运行
flutter run -d deviceid
17 app_plugin_loader.gradle' as it does not exist.
更新 flutter sdk flutter/bin/flutter upgrade
最后
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.17.0, on Mac OS X 10.14.6 18G3020, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
[✓] Android Studio (version 3.6)
[!] IntelliJ IDEA Ultimate Edition (version 2019.1.3)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[!] IntelliJ IDEA Community Edition (version 2019.1.3)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.45.0)
[✓] Connected device (1 available)
! Doctor found issues in 2 categories.
成功了
18. flutter 导入第三方 SDK [参考](https://blog.csdn.net/Crazy_SunShine/article/details/80355291
)
- flutter ... 文件夹更改配置 参考