React Native错误:您试图通过调用www.example来使用未在iOS项目上本机安装的firebase模块 www.example.com ()

bq3bfh9z  于 2023-05-01  发布在  React
关注(0)|答案(1)|浏览(93)

我在iOS和Android面临的错误是工作正常.错误:`错误:您试图通过调用www.example来使用未在iOS项目上本机安装的firebase模块 www.example.com ().
确保您已链接该模块或将其添加到项目Podfile中。”
Pod文件

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '11.0'

target 'App' do
  config = use_native_modules!
  
 
    rn_maps_path = '../node_modules/react-native-maps'
    pod 'react-native-maps', path: rn_maps_path
    pod 'react-native-google-maps', :path => rn_maps_path
    pod 'GoogleMaps'
    pod 'Google-Maps-iOS-Utils'
    pod 'Firebase/Storage'
    pod 'GoogleUtilities'

  use_react_native!(:path => config["reactNativePath"]
      # to enable hermes on iOS, change `false` to `true` and then install pods
     )
  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
  pod 'react-native-maps', :path => '../node_modules/react-native-maps'

  target 'APPTests' do
    inherit! :complete
    # Pods for testing
  end

请帮我解决这个问题

bmvo0sr5

bmvo0sr51#

因此,你的react native版本大于0。60.1,当您构建项目时,会自动创建链接。您需要在项目的根文件夹中运行这些命令。

cd ios/
pod install --repo-update
cd ..
npx react-native run-ios

相关问题