美文网首页Flutter
Flutter 引入audioplayers三方库编译报错

Flutter 引入audioplayers三方库编译报错

作者: 伊路顺峰 | 来源:发表于2021-12-10 14:39 被阅读0次

新项目引入 audioplayers库以后 在iOS模拟器上编译报错

error: Build input file cannot be found: '/Users/wf/Documents/workspace/project/flutter/recite-words/ios/Runner/text.swift' (in target 'Runner' from project 'Runner')
    error: Build input file cannot be found: '/Users/wf/Documents/workspace/project/flutter/recite-words/ios/Runner/text.swift' (in target 'Runner' from project 'Runner')
    error: the following command failed with exit code 1 but produced no further output
    CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Analyzing workspace
    note: Constructing build description
    note: Build preparation complete
    /Users/wf/Documents/workspace/project/flutter/recite-words/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 4.3, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'Toast' from project 'Pods')
    /Users/wf/Documents/workspace/project/flutter/recite-words/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 4.3, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'FMDB' from project 'Pods')

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

刚开始以为是版本的问题,后来试了各个版本发现都会报错,经过各种百度会才知道原来是在iOS项目中缺少.swift 和 .m 的桥接文件(我的iOS项目是用的OC语言),解决方法,随便新建一个Swift文件,新建成功后就会提示是否新建桥接文件,点击确定就会生成一个Runner-Bridging-Header.h 文件,然后把新建的.swift 文件删掉,重新编译就正常了。

image.png
image.png
image.png
image.png

相关文章

网友评论

    本文标题:Flutter 引入audioplayers三方库编译报错

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