【问题标题】:my build is working on VS code but not on Xcode我的构建适用于 VS 代码,但不适用于 Xcode
【发布时间】:2020-11-23 09:30:46
【问题描述】:

当我在 iOS 上使用 vs code 启动我的应用程序时,构建成功,但是当您更改屏幕时应用程序崩溃了。

当我打开我的 Xcode 时,构建直接失败并出现错误

fatal error: module map file '/Users/wendy/Library/Developer/Xcode/DerivedData/Klaaap-feojqlwiozdtgsczazhciamgtbgk/Build/Products/Debug-iphonesimulator/YogaKit/YogaKit.modulemap' not found
1 error generated.

这是我的Podfile

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

platform :ios, '14.2'

target 'Klaaap' do
  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])





  pod 'RNSoundLevel', :path => '../node_modules/react-native-sound-level'

  pod 'RNPermissions', :path => '../node_modules/react-native-permissions'

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

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  use_flipper!
  post_install do |installer|
    flipper_post_install(installer)
  end
end

target 'Klaaap-tvOS' do
  # Pods for Klaaap-tvOS

  target 'Klaaap-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end
end

target 'WonderPushNotificationServiceExtension' do
  platform :ios, '10.0'

  # Pods for WonderPushNotificationServiceExtension
  pod 'WonderPushExtension', '~> 3.0'
end

还有我的 Xcode:

你对此有什么想法吗?

【问题讨论】:

  • 这个错误很清楚,说你试图告诉你的 cocoapods 使用一个名为WonderPushNotificationServiceExtension 的目标并且它在你的项目中不存在。检查目标的名称
  • 是的,但你知道这个错误是否是我构建的问题吗?
  • 是的,cocoapods 无法运行,因为您给了它无效的指令。如果 cocoapods 无法下载您的依赖项,那么您的项目将无法构建。即使这不是问题,如果您的核心关键工具之一报告错误,您也需要修复它,否则它会破坏某些东西
  • 是的,当然,我只是找不到我必须更改它的地方,因为在 Xcode 中,WonderPushNotification 就在那里:(
  • 除非您向我们展示,否则没有其他人可以提供帮助。在 xcode 中上传目标的屏幕截图并在此处复制您的 podfile

标签: ios xcode visual-studio-code wonderpush


【解决方案1】:

错误告诉您,您已要求 cocoapods 对名为“WonderPushNotificationServiceExtension”的目标执行某些操作,但该目标不存在。从您上面的编辑和屏幕截图来看,您从未创建过。

出于兴趣,我在 Google 上搜索了 WonderPushNotificationServiceExtension 是什么,它把我带到了 WonderPush iOS 文档。从外观上看,您正试图将此第三方服务合并到您的应用程序中,但没有遵循他们文档的后半部分,展示如何创建目标和添加服务扩展。

您需要返回并重新开始,确保按照以下链接中的所有步骤操作。

React-Native 教程链接:
https://docs.wonderpush.com/docs/mobile-push-notifications-react-native

【讨论】:

    猜你喜欢
    • 2020-08-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-25
    相关资源
    最近更新 更多