首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >React已弃用- React Native

React已弃用- React Native
EN

Stack Overflow用户
提问于 2020-08-26 18:55:49
回答 1查看 792关注 0票数 0

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

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

下面是Xcode错误。

我运行的是react native 0.63.2。

这是我的pod文件

代码语言:javascript
复制
# 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

EN

回答 1

Stack Overflow用户

发布于 2020-08-26 21:14:51

问题是您没有为正确的目标安装pod。如果这是一个新的RN项目,这是很奇怪的,因为它应该采用正确的目标。在您最近添加的映像中,您似乎有另一个名为AntrimElimChurch的目标,因此,如果您想为该目标安装pod,您也应该在PodFile中更改它

代码语言:javascript
复制
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,它应该构建

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63596100

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档