初始化本机ReactLocalization模块时出错了。请检查您的配置:您是否运行'react-native link'?

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

enter image description here

我试图在我的ReactNative应用程序中使用库本发明的本地化,当我尝试运行时,我得到以下错误:

任何想法如何解决?

ios react-native module localization
1个回答
0
投票

我找到了解决自己问题的方法。添加到“Podfile”这2行:

pod ‘ReactNativeLocalization’,
     :path => “../node_modules/react-native-localization”

这是我完整的“PodFile”示例。

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'Transit' do
  project 'Transit.xcodeproj'
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
#  use_frameworks!
 pod ‘Firebase/Core’
 pod ‘Firebase/Messaging’
 pod ‘ReactNativeLocalization’,
 :path => “../node_modules/react-native-localization”

end
$

然后执行命令

pod install

安装必要的组件。

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