首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >找不到模块'audio_session‘

找不到模块'audio_session‘
EN

Stack Overflow用户
提问于 2021-03-18 13:20:22
回答 5查看 7.5K关注 0票数 11

我试图建立一个现有的颤振项目在一个新的Mac与M1芯片。在audio_session模块丢失方面,我面临以下错误。

代码语言:javascript
运行
复制
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.

有什么想法吗?

EN

回答 5

Stack Overflow用户

回答已采纳

发布于 2021-03-18 14:58:25

终于找到了解决办法。

不知何故,如果我转到我的颤振项目的iOS文件夹并键入‘project;Podfile’,就会生成一个基本的Podfile(这意味着它只指定了平台)。

我在某个地方找到了一篇文章,建议删除iOS文件夹中关于pod的所有内容,并在项目中运行。在项目文件夹中运行“颤振运行”(也集成了‘Podfile’),生成了一个非常详细的Podfile,但是这次我在平台方面遇到了另一个错误(如下所示)。

代码语言:javascript
运行
复制
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

  • Right点击终端->获取信息

  • 检查‘用Rosetta'

  • Open打开一个新终端并键入'gem卸载cocoapods'

  • sudo创业板安装cocoapods

  • gem卸载ffi

  • arch -x86_64 sudo创业板安装ffi

我希望这对其他人有用。

票数 4
EN

Stack Overflow用户

发布于 2021-05-14 12:28:33

你应该

1.打开xcode中的"Runner.xcworkspace“,而不是"Runner.xcodeproj”

2.一切都很顺利

票数 8
EN

Stack Overflow用户

发布于 2022-07-14 16:49:40

在我的例子中,我已经将platform :ios更改为'13.0',但我的iOS Deployment Target'9.0'。我把这两样都留下了,它又开始起作用了。

确保平台: pod文件中的iOS版本与Xcode中的部署信息匹配

学分:thanhbinh84

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66691954

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档