如何修复在 Apple Silicon Mac(M1 或 M2)上构建的 Flutter 包 flutter_video_cast 破坏 iOS 模拟器

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

我的问题:

flutter_video_cast
包添加到我的项目中会停止在 Apple Silicon Mac 上为 arm64 构建。

Error (Xcode): In /<path>/ios/Pods/google-cast-sdk-no-bluetooth/GoogleCastSDK-ios-4.6.1_static/GoogleCast.framework/GoogleCast(aligned_new_bca0ac320467a2457b3e306bfed17856.o), building for iOS Simulator, 
but linking in object file built for iOS, 
file '/<path>/ios/Pods/google-cast-sdk-no-bluetooth/GoogleCastSDK-ios-4.6.1_static/GoogleCast.framework/GoogleCast' 
for architecture arm64
  • 请注意:如果我从 Xcode 项目中的 iOS 模拟器构建中排除 arm64,它确实构建了,但是滚动/惯性被破坏了。

  • 当我检查“获取信息”属性时,我也有no选项来使用Rosetta打开模拟器。

所以我尝试过的事情:

  • 分叉插件并将 arm64 添加到 VALID_ARCHS 中的 podspec 文件
  • 从 podspec 文件中删除 VALID_ARCHS
  • 在 Flutter 配置中设置 podfile:
config.build_settings['VALID_ARCHS[sdk=iphonesimulator*]'] = 'x86_64 arm64'
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "i386"  

以上均无效。

Q) 当特定包未在其 podspec 文件中指定 arm64 时,是否有人设法为 iOS 模拟器构建项目?

谢谢。

flutter build package arm64 apple-silicon
1个回答
0
投票

我有同样的问题,但 google.maps 依赖。你能解决它吗? 谢谢

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