我有一个 Flutter 项目,我试图在 iOS 上运行。它在我的基于 Intel 的 Mac 上正常运行,但在我新的基于 Apple Silicon 的 M1 Mac 上它无法安装 pod。
LoadError - dlsym(0x7f8926035eb0, Init_ffi_c): symbol not found - /Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/lib/ffi_c.bundle
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/lib/ffi.rb:6:in `rescue in <top (required)>'
/Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/lib/ffi.rb:3:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/ethon-0.12.0/lib/ethon.rb:2:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/typhoeus-1.4.0/lib/typhoeus.rb:2:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/sources_manager.rb:74:in `cdn_url?'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/sources_manager.rb:36:in `create_source_with_url'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/sources_manager.rb:21:in `find_or_create_source_with_url'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:178:in `block in sources'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:177:in `map'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:177:in `sources'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:1073:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:1072:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:414:in …Run Code Online (Sandbox Code Playgroud) 我是本机反应新手,并且一直在创建一个新应用程序。我尝试将我的项目从 React Native 0.60 更新到 0.63。执行此操作时,我必须创建一个新的项目文件才能更新我的 cocoapods。完成此操作后,我厌倦了在 iOS 模拟器上运行我的应用程序,但出现错误。
在 Xcode 中打开我的项目时,出现以下错误。
我不确定这是否与我的豆荚有关。在网上做了一些研究后,我无法找到这个问题的答案。
这是我的个人资料文件。
# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
target 'Example' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Example
target 'ExampleTests' do
inherit! :search_paths
# Pods for testing
end
end
target 'Example-tvOS' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# …Run Code Online (Sandbox Code Playgroud)当我尝试在 Xcode 或命令行中在 ios 上运行时,我遇到了“词法或预处理器”问题。Android 构建良好。
第一个错误是找不到“React/RCTBridgeModule.h”文件。我可以通过更改<React/RCTBridgeModule.h>为来解决这个问题,"RCTBridgeModule.h"但我最终会遇到每个模块都出现同样问题的无穷无尽的问题。
我不相信这是一个重复的问题。我已经尝试了类似问题和 github 问题中的所有解决方案,但仍然无法构建;
#import <React/RCTBridgeModule.h>node_modules,.xcworkspace并podfile.lock和重新安装/使用两个更新npm和yarnreact-native upgrade请检查图像的路径
反应原生信息:
Environment:
OS: macOS High Sierra 10.13.6
Node: 8.11.1
Yarn: 1.12.3
npm: 6.5.0
Watchman: 4.9.0
Xcode: Xcode 10.1 Build version 10B61
Android Studio: 3.2 AI-181.5540.7.32.5056338
Packages: (wanted => installed)
react: …Run Code Online (Sandbox Code Playgroud)