[!] Xcode - develop for iOS and macOS ✗ 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. To re-install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
1 2 3
# 清理旧版本,Remove stale lock files and outdated downloads for all formulae and casks, and remove old versions of installed formulae. brew cleanup -d -v brew install cocoapods | brew upgrade cocoapods
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3) ✗ Android SDK file not found: /Users/kuangyimin/Library/Android/sdk/platforms/android-30/android.jar.
下面的问题,按提示,Run flutter doctor --android-licenses
1 2 3 4 5
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3) ✗ Android license status unknown. Run `flutter doctor --android-licenses`to accept the SDK licenses. See https://flutter.dev/docs/get-started/install/macos#android-setupfor more details.
如果出现了这个问题,则可以在 Android SDK 面板设置 “command line tools”,勾选,然后安装
1 2 3
flutter doctor --android-licenses Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
如果 flutter run 的时候提示这个问题,则可以按提示,去 Android Studio,搜 SDK,下载对应缺少的 SDK
1 2 3 4
Could not determine the dependencies of task ':launch_review:compileDebugAidl'. > Failed to install the following SDK components: platforms;android-28 Android SDK Platform 28 Install the missing components usingthe SDK manager in Android Studio.
Available commands: analyze Analyze the project's Dart code. assemble Assemble and build Flutter resources. attach Attach to a running app. bash-completion Output command lineshell completion setup scripts. build Build an executable app or install bundle. channel List or switch Flutter channels. clean Delete the build/ and .dart_tool/ directories. config Configure Flutter settings. create Create a new Flutter project. devices List all connected devices. doctor Show information about the installed tooling. downgrade Downgrade Flutter to the last active versionfor the current channel. drive Run integration tests for the project onan attached device or emulator. emulators List, launch and create emulators. formatFormatone or more Dart files. gen-l10n Generate localizations for the current project. install Install a Flutter apponan attached device. logs Show log output for running Flutter apps. precache Populate the Flutter tool's cache of binary artifacts. pub Commands for managing Flutter packages. runRun your Flutter apponan attached device. screenshot Take a screenshot from a connected device. symbolize Symbolize a stack trace from an AOT-compiled Flutter app. testRun Flutter unit tests for the current project. upgrade Upgrade your copy of Flutter.
Run"flutter help <command>"formore information about a command. Run"flutter help -v"for verbose help output, including less commonly used options.
1 2 3
Create a new Flutter project. If run on a project that already exists, this will repair the project, recreating any files that are missing. 如果想要生成对应iOS,android文件,可以 flutter create .
调试问题
1 2 3 4 5
vm-service: Error: Unhandled exception: WebSocketException: Invalid WebSocket upgrade request [VERBOSE-2:dart_isolate.cc(1137)] Unhandled exception: WebSocketException: Invalid WebSocket upgrade request Error connecting to the service protocol: failed to connect to http://127.0.0.1:55440/xxxxx=/
Specifies the platform for which a static library should be built.
1 2 3 4
podfile: # Uncomment this line to define a global platform for your project platform :ios, '9.0' https://guides.cocoapods.org/syntax/podfile.html#platform