导入 iOS 中找不到的'GoogleMobileAds'(本机反应)



我在我的项目中安装react-native-Admob时遇到了这个错误。谁能告诉我怎么解决这个问题?

我通过在我的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, '10.0'
target 'testing' do
config = use_native_modules!
use_react_native!(
:path => config[:reactNativePath],
# to enable hermes on iOS, change `false` to `true` and then install pods
:hermes_enabled => false
)
pod 'Interactable', :path => '../node_modules/react-native-interactable'
pod 'react-native-admob', path: '../node_modules/react-native-admob' <======= add this line

target 'lpgTests' do
inherit! :complete
# Pods for testing
pod 'Google-Mobile-Ads-SDK' <====== add this line
end

use_flipper!()
post_install do |installer|
react_native_post_install(installer)
end
end

如果你使用的是M1硅芯片,你仍然会得到一个错误&要解决这个错误,你必须运行两个命令

#1 Install ffi
sudo arch -x86_64 gem install ffi
#2 Re-install dependencies
arch -x86_64 pod install

相关内容

  • 没有找到相关文章

最新更新