我对移动开发非常陌生,我尝试实施 firebase。但是,我在构建项目时遇到了问题。一堆模块无法构建:
这是错误日志的示例:
这就是我的 Podfile 现在的样子:
# Resolve react_native_pods.rb with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
'require.resolve(
"react-native/scripts/react_native_pods.rb",
{paths: [process.argv[1]]},
)', __dir__]).strip
platform :ios, '13.4'
prepare_react_native_project!
# Include ReactCommon dependencies
pod 'ReactCommon', :path => '../node_modules/react-native/ReactCommon'
pod 'ReactCommon/turbomodule/core', :path => '../node_modules/react-native/ReactCommon'
linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
use_frameworks! :linkage => linkage.to_sym
end
target 'CampusWatch' do
config = use_native_modules!
use_react_native!(
:path => config[:reactNativePath],
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
# Apply modular headers only to specific Firebase-related pods
pod 'FirebaseCore', :modular_headers => true
pod 'Firebase', :modular_headers => true
pod 'FirebaseCoreInternal', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
target 'CampusWatchTests' do
inherit! :complete
# Pods for testing
end
post_install do |installer|
react_native_post_install(installer, config[:reactNativePath])
# Optionally, handle ReactCommon modulemap conflicts
# system("rm -rf Pods/Target\\ Support\\ Files/ReactCommon/ReactCommon.modulemap")
end
end
我尝试询问chatgpt,它告诉我将项目和项目目标的标题搜索路径和库搜索路径更改为这样:
它还建议我将框架添加到“将二进制文件与库链接”下的构建阶段,但我没有看到任何更改
如果有人可以帮忙,我将不胜感激!
您的
errors
屏幕截图显示权限错误,而您的模块失败问题是您没有安装node_modules
。
尝试使用
sudo
运行命令。
并确保您有
node_modules
文件夹并且已完成 pod 安装(即转到 cd /ios 并运行 pod install
)