我试图建立一个现有的颤振项目在一个新的Mac与M1芯片。在audio_session模块丢失方面,我面临以下错误。
Launching lib/main.dart on iPhone 12 in debug mode...
Running Xcode build...
└─Compiling, linking and signing... 340ms
Xcode build done. 4.7s
Failed to build iOS app
Error output from Xcode build:
↳
objc[7636]: Class AMSupportURLConnectionDelegate is implemented in both ?? (0x1f2fe0188) and ?? (0x117e8c2b8). One of the two will be used. Which one is undefined.
objc[7636]: Class AMSupportURLSession is implemented in both ?? (0x1f2fe01d8) and ?? (0x117e8c308). One of the two will be used. Which one is undefined.
** BUILD FAILED **
Xcode's output:
↳
/Users/user/Projects/myproject/ios/Runner/GeneratedPluginRegistrant.m:10:9: fatal error: module 'audio_session' not found
@import audio_session;
~~~~~~~^~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone 12.
有什么想法吗?
发布于 2021-03-18 14:58:25
终于找到了解决办法。
不知何故,如果我转到我的颤振项目的iOS文件夹并键入‘project;Podfile’,就会生成一个基本的Podfile(这意味着它只指定了平台)。
我在某个地方找到了一篇文章,建议删除iOS文件夹中关于pod的所有内容,并在项目中运行。在项目文件夹中运行“颤振运行”(也集成了‘Podfile’),生成了一个非常详细的Podfile,但是这次我在平台方面遇到了另一个错误(如下所示)。
Error output from CocoaPods:
↳
[!] Automatically assigning platform `iOS` with version `12.0` on target
`Runner` because no platform was specified. Please specify a platform for
this target in your Podfile. See
`https://guides.cocoapods.org/syntax/podfile.html#platform`.
Error: To set up CocoaPods for ARM macOS, run:
arch -x86_64 sudo gem install ffi
我试着按照建议运行上面显示的命令,但也发生了同样的错误。
然后,我在这里找到了一个类似于官方文档Running Cocoapods on Apple Silicon (M1)的答案。
即使如此,堆栈溢出的答案直到我遵循以下步骤后才能直接对我起作用:
Utilities
我希望这对其他人有用。
发布于 2021-05-14 12:28:33
你应该
1.打开xcode中的"Runner.xcworkspace“,而不是"Runner.xcodeproj”
2.一切都很顺利
发布于 2022-07-14 16:49:40
在我的例子中,我已经将platform :ios
更改为'13.0'
,但我的iOS Deployment Target
是'9.0'
。我把这两样都留下了,它又开始起作用了。
确保平台: pod文件中的iOS版本与Xcode中的部署信息匹配
学分:thanhbinh84
https://stackoverflow.com/questions/66691954
复制相似问题