flutter 安裝以及遇到的坑

flutter 安裝遇到的坑

1.網(wǎng)站和教程

flutter 中文網(wǎng)

也可以看這個(gè)

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

打開(kāi) Android studio,會(huì)提示安裝,慢慢等待吧。

5.Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

執(zhí)行命令: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源,因?yàn)楝F(xiàn)在默認(rèn)是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 出現(xiàn):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. 真機(jī)運(yùn)行

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 導(dǎo)入第三方 SDK [參考](https://blog.csdn.net/Crazy_SunShine/article/details/80355291

)

  1. flutter ... 文件夾更改配置 參考
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容