我正在使用React Native创建一个应用程序,并尝试为iOS安装可可豆荚,但当我在终端中输入pod install时,我收到以下警告。

然后,当我尝试在iOS模拟器中运行我的应用程序时,它崩溃了,不能运行。
下面是Xcode错误。

我运行的是react native 0.63.2。
这是我的pod文件
# Uncomment the next line to define a global platform for your project
platform :ios, '11.0'
require_relative '../node_modules/react-native/scripts/react_native_pods'
target 'Example' do
# Comment the next line if you don't want to use dynamic frameworks
#use_frameworks!
# Pods for Example
# pod 'React', :path => '../node_modules/react-native'
pod 'RNSound', :path => '../node_modules/react-native-sound'
pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-community/async-storage'
pod 'RNCMaskedView', :path => '../node_modules/@react-native-community/masked-view'
pod 'RNCPushNotificationIOS', :path => '../node_modules/@react-native-community/push-notification-ios'
pod 'react-native-slider', :path => '../node_modules/@react-native-community/slider'
pod 'RNFBApp', :path => '../node_modules/@react-native-firebase/app'
pod 'RNFBAuth', :path => '../node_modules/@react-native-firebase/auth'
pod 'RNFBMessaging', :path => '../node_modules/@react-native-firebase/messaging'
pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios'
pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
pod 'RNReanimated', :path => '../node_modules/react-native-reanimated'
pod 'react-native-safe-area-context', :path => '../node_modules/react-native-safe-area-context'
pod 'RNScreens', :path => '../node_modules/react-native-screens'
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
target 'Example-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
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!
# Pods for Example-tvOS
end
发布于 2020-08-26 21:14:51
问题是您没有为正确的目标安装pod。如果这是一个新的RN项目,这是很奇怪的,因为它应该采用正确的目标。在您最近添加的映像中,您似乎有另一个名为AntrimElimChurch的目标,因此,如果您想为该目标安装pod,您也应该在PodFile中更改它
am running react native 0.63.2.
Here is my pod file
# Uncomment the next line to define a global platform for your project
platform :ios, '11.0'
require_relative '../node_modules/react-native/scripts/react_native_pods'
target 'AntrimElimChurch' do
# Comment the next line if you don't want to use dynamic frameworks
#use_frameworks!
# Pods for Example
# pod 'React', :path => '../node_modules/react-native'
pod 'RNSound', :path => '../node_modules/react-native-sound'
pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-community/async-storage'
pod 'RNCMaskedView', :path => '../node_modules/@react-native-community/masked-view'
pod 'RNCPushNotificationIOS', :path => '../node_modules/@react-native-community/push-notification-ios'
pod 'react-native-slider', :path => '../node_modules/@react-native-community/slider'
pod 'RNFBApp', :path => '../node_modules/@react-native-firebase/app'
pod 'RNFBAuth', :path => '../node_modules/@react-native-firebase/auth'
pod 'RNFBMessaging', :path => '../node_modules/@react-native-firebase/messaging'
pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios'
pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
pod 'RNReanimated', :path => '../node_modules/react-native-reanimated'
pod 'react-native-safe-area-context', :path => '../node_modules/react-native-safe-area-context'
pod 'RNScreens', :path => '../node_modules/react-native-screens'
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
target 'Example-tvOSTests' do
inherit! :search_paths
# Pods for testing
pod 'react-native-notifications', :path => '../node_modules/react-native-notifications'
end
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!
# Pods for Example-tvOS
end在此更改之后,再次运行pod install,它应该构建
https://stackoverflow.com/questions/63596100
复制相似问题