美文网首页
Flutter 错误汇总

Flutter 错误汇总

作者: Gary_fei | 来源:发表于2020-04-09 09:43 被阅读0次
  1. Android Studio 创建新Flutter项目,弹框一直提示Creating状态
    打开终端,运行flutter doctor,提示
    Waiting for another flutter command to release the startup lock

解决:

  1. 打开flutter的安装目录
    ~/flutter/bin/cache
  2. 删除lockfile文件
  3. 重启AndroidStudio,可正常新建
    终端运行flutter doctor,也可正常运行
  1. AS运行项目,使用iOS模拟器,插件失效后会报错如下
Launching lib/main.dart on iPhone 11 Pro in debug mode...
Running Xcode build...
Xcode build done.                                           26.0s
Failed to build iOS app
Error output from Xcode build:
↳
     xcodebuild[11036:4038649] [MT] PluginLoading: Required plug-in compatibility UUID C80A9C11-3902-4885-944E-A035869BA910 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin' not present in DVTPlugInCompatibilityUUIDs
    ** BUILD FAILED **


Xcode's output:
↳
    ld: can't map file, errno=22 file 'Flutter' for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description
    warning: The use of Swift 3 @objc inference in Swift 4 mode is deprecated. Please address deprecated @objc inference warnings, test your code with “Use of deprecated Swift 3 @objc inference” logging enabled, and then disable inference by changing the "Swift 3 @objc Inference" build setting to "Default" for the "Runner" target. (in target 'Runner' from project 'Runner')

Could not build the application for the simulator.
Error launching application on iPhone 11 Pro.

解决:

  1. 获取Xcode的UUID
    终端输入defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID
  2. 前往文件夹,打开目录
    ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins找到RevealPlugin.xcplugin
  3. 右键显示包内容
    info.plist->DVTPlugInCompatibilityUUIDs,把上面的UUID复制进去
  4. 重新运行项目,可以正常运行
  1. Xcode升级,AS运行项目,会报错
Building for iOS, but the linked and embedded framework 'App.framework'

解决:

  1. 在根项目目录下,Clean下项目
    flutter clean
  2. 删除App.framework
    rm -rf ios/Flutter/App.framework
  3. 再重新运行下Flutter,就ok了

相关文章

网友评论

      本文标题:Flutter 错误汇总

      本文链接:https://www.haomeiwen.com/subject/rxyxmhtx.html