首先參照官方文檔進行搭建Mac下的環境 ,然後就會遇到以下問題: 1.在下載了Flutter 之後,執行Flutter doctor之後,報錯: Could not resolve URL "https://pub.flutter-io.cn". Could not resolve URL "htt ...
首先參照官方文檔進行搭建Mac下的環境 ,然後就會遇到以下問題: 1.在下載了Flutter 之後,執行Flutter doctor之後,報錯:
Could not resolve URL "https://pub.flutter-io.cn".
Unable to 'pub upgrade' flutter tool
解決方法: 重新打開終端:執行以下設置 export PUB_HOSTED_URL=https://pub.flutter-io.cn export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn export PATH="$PWD/flutter/bin:$PATH" 2.執行之後報錯:
Android sdkmanager tool not found
(/Users/zhinengpingtai/Documents/AndroidTools/android-sdk-macosx/tools/bin/sdkma
nager).
Try re-installing or updating your Android SDK,
visit https://flutter.io/setup/#android-setup for detailed instructions.
解決方法:通過Android studio的自帶的SDK 管理工具,升級Android Emulator
3.在之後執行flutter doctor會提示一些
Some Android licenses not accepted. To resolve this, run: flutter doctor
--android-licenses
按他們的建議直接執行 flutter doctor --android-licenses
4.運行Android Studio的Flutter的例子 ,無法使用熱載入, AS報錯:
Error waiting for a debug connection: ProcessException: adb did not report forwarded port
解決方法:直接更新SDK Platform-Tools 即可。
5.運行iOS的時候,執行flutter run 報錯:
Cannot find "xcodebuild". Xcode 9.0 or greater is required to develop for iOS.
Could not build the precompiled application for the device.
解決方法:可能需要更新XCode
6.通過直接在XCODE裡面運行會報錯:
Xcode will continue when iPhone is connected.
解決方法:XCode的版本太低,升級XCode版本或者使用低版本的iOS進行驗證。