Xcode 12.4 为 iOS 模拟器构建,但链接到为 iOS 构建的 dylib,

问题描述 投票:0回答:3

我正在构建一个 flutter 聊天应用程序,

在 ios 设备上运行它时,我收到以下错误。

ld: building for iOS Simulator, but linking in dylib built for iOS, file '/Users/drole/Documents/chat/ios/Pods/AgoraRtcEngine_iOS/AgoraAIDenoiseExtension.framework/AgoraAIDenoiseExtension' for architecture arm64

我应该怎么做才能解决该错误, 我尝试在互联网上冲浪但我没有得到正确的解决方案。

ios xcode flutter dylib
3个回答
0
投票

在 Podfile 中添加这个

post_install do |installer|
  projects = installer.aggregate_targets
   .map{ |t| t.user_project }
   .uniq{ |p| p.path }
   .push(installer.pods_project)
   installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
   end

  projects.each do |project|
   project.build_configurations.each do |config|
    config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 
   'arm64'
   end

   project.save()
 end
 end

0
投票

在 Podfile 中添加此内容或检查此链接 https://github.com/mapbox/mapbox-gl-native-ios/issues/487#issuecomment-1163332686

post_install do |installer|
  projects = installer.aggregate_targets
   .map{ |t| t.user_project }
   .uniq{ |p| p.path }
   .push(installer.pods_project)
   installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
   end

  projects.each do |project|
   project.build_configurations.each do |config|
    config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 
   'arm64'
   end

   project.save()
 end
 end

0
投票

按照以下步骤操作:

解决方案1

右键单击应用程序文件夹中的 Xcode

获取信息

使用 Rosetta 检查打开

打开Xcode

打开项目

清理构建文件夹

运行项目

通过使用 Rosseta 打开 Xcode,不需要其他构建设置或配置。

解决方案2

进入菜单栏“产品”

目的地

目的地架构

同时显示

从设备下拉菜单中选择旁边有 Rosseta 的模拟器。

运行项目

解决方案3

转到 Pods 跟踪错误 pod lib 在排除架构中 → 在调试和发布中点击 + 按钮 → 在调试和发布中。

© www.soinside.com 2019 - 2024. All rights reserved.