美文网首页
flutter 错误/疑难杂症记录

flutter 错误/疑难杂症记录

作者: IMKel | 来源:发表于2023-04-26 11:03 被阅读0次
  • Could not find the built application bundle at build/ios/iphonesimulator/Runner.app


    image.png

解决方法:
项目创建环境:macOS 13.2 + Xcode 14.3 + vscode 1.78.2,
出现此问题时的运行环境:macos 12.6.6 + 14.2 + vscode 1.78.2
经过测试,估计是macos 系统不兼容的问题,解决方法要么升级macos 12.6.6 ->到 macOS 13.2,要么项目创建时使用后者环境去创建。

  • ! Warning: flutter on your path resolves to /Users/mac/fvm/versions/2.10.4/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/mac/fvm/versions/3.7.11. Consider adding /Users/mac/fvm/versions/3.7.11/bin to the front of your path.意思就是flutter SDK 路径异常
    image.png

解决方法:
1、vscode 中凡是设置了dart 和flutter sdk 路径的都删掉
2、vscode 中禁用flutter和dart插件,然后再重新启用
3、执行flutter doctor检查有没有问题
4、执行flutter doctor,flutter pub get,再次运行项目

  • Can't load Kernel binary: Invalid kernel binary format version
    这个错误表示 Get 依赖的 Dart/Flutter 版本与现在的环境不兼容,使用新的flutter sdk吧。

  • CocoaPods not installed or not in valid state./CocoaPods not installed. Skipping pod install.

image.png

解决方法:执行下flutter doctor确保cocoapods是否安装,没有就去装,有的话接着执行flutter cleanflutter pub getcd iospod install,然后项目就可以运行起来了

  • could not build the precompiled application for the device. 插件找不到错误,如下图:
image.png

解决方案:
path_provider_foundation降低版本号至2.2.1修复此问题。

  • 提示执行flutter precache --ios


    image.png

注意:如果使用了fvm,则应该执行fvm flutter precache --ios。

  • Error (Xcode): 'requestAuthorization' is only available in iOS 9.3 or newer


    image.png

解决方案:
1、在Xcode修改项目最低支持的版本号
2、在Podfile文件中修改最低版本号:
platform :ios, '11.0'以及config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'

相关文章

网友评论

      本文标题:flutter 错误/疑难杂症记录

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