为什么命令';反应本机运行ios';升级到0.63.3后生成失败?

为什么命令';反应本机运行ios';升级到0.63.3后生成失败?,ios,react-native,react-native-ios,react-native-cli,Ios,React Native,React Native Ios,React Native Cli,我刚刚更新到RN v0.63.3。在更改应用程序名称后,我在以前的react native版本上遇到了问题,该应用程序的名称不同,项目/方案的名称也不同,但问题从未得到解决,每个人都说只是升级 现在在v0.63.3上,在react native run ios之后仍然存在生成失败的问题。这次错误是: **构建失败** 以下生成命令失败: CompileC/Users/vorousjames/Library/Developer/Xcode/DerivedData/-gdmnlxiprekjqhfi

我刚刚更新到RN v0.63.3。在更改应用程序名称后,我在以前的react native版本上遇到了问题,该应用程序的名称不同,项目/方案的名称也不同,但问题从未得到解决,每个人都说只是升级

现在在v0.63.3上,在
react native run ios
之后仍然存在生成失败的问题。这次错误是:

**构建失败**

以下生成命令失败: CompileC/Users/vorousjames/Library/Developer/Xcode/DerivedData/-gdmnlxiprekjqhfiueouiidqhqnl/Build/Intermediates.noindex/.Build/Debug iphonesimulator/.Build/Objects normal/x86_64/AppDelegate.o /Users/Desktop/Development/App/iOS//AppDelegate.m 普通x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (1次失败)

从Xcode内部构建/运行没有问题。仅使用
react本机运行ios

编辑:我想可能是因为我刚刚调用了
react native run ios
,所以全局安装了cli。我相信使用全球安装。因此,由于它已经过时,我在全球范围内卸载了它,并尝试使用带有
npx react native run ios
的社区软件包。现在它又出现了一个comileC错误,但不同

**构建失败**

以下生成命令失败: CompileC/Users/Library/Developer/Xcode/DerivedData/App gdmnlxiprekjqhfiueouiidqhqnl/Build/Intermediates.noindex/Pods.Build/Debug iphonesimulator/RNFirebase.Build/Objects normal/x86_64/rnfirebasemaging.o /用户/Desktop/Development/App/node_modules/react native firebase/ios/RNFirebase/messaging/rnfirebasemsaging.m 普通x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler CompileC/Users/Library/Developer/Xcode/DerivedData/App gdmnlxiprekjqhfiueouiidqhqnl/Build/Intermediates.noindex/Pods.Build/Debug iphonesimulator/RNFirebase.Build/Objects normal/x86_64/rnfirebaseforestore.o /用户/Desktop/Development/App/node_modules/react native firebase/ios/RNFirebase/firestore/RNFirebase firestore.m 普通x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (2次失败)

这完全扼杀了我快速迭代的能力,欢迎任何建议

反应本机:0.63.3 react本机cli(全局):2.0.1 react本地社区/cli:^4.8.0 Xcode:12.0.1 iOS:14.0.1

更新日期:

package.json:

{
    "name": "Aflare",
    "version": "0.0.1",
    "private": true,
    "scripts": {
        "android": "react-native run-android",
        "ios": "react-native run-ios",
        "start": "react-native start",
        "test": "jest",
        "lint": "eslint ."
    },
    "dependencies": {
        "@react-native-community/cli": "^4.8.0",
        "@react-native-community/clipboard": "^1.2.2",
        "algoliasearch": "^3.16.0",
        "appcenter": "3.1.1",
        "appcenter-analytics": "3.1.1",
        "appcenter-crashes": "3.1.1",
        "axios": "^0.19.2",
        "moment": "^2.24.0",
        "moment-timezone": "^0.5.27",
        "prop-types": "^15.7.2",
        "react": "^16.13.1",
        "react-native": "^0.63.3",
        "react-native-agora": "^3.1.3",
        "react-native-algolia-dropdown": "^1.6.0",
        "react-native-calendars": "^1.220.0",
        "react-native-chart-kit": "^4.3.0",
        "react-native-code-push": "^6.0.0",
        "react-native-extended-stylesheet": "^0.12.0",
        "react-native-firebase": "^5.6.0",
        "react-native-gesture-handler": "^1.5.2",
        "react-native-image-crop-picker": "^0.26.1",
        "react-native-material-dropdown": "^0.11.1",
        "react-native-reanimated": "^1.4.0",
        "react-native-responsive-screen": "^1.4.1",
        "react-native-safe-area-context": "^0.6.2",
        "react-native-screens": "^1.0.0-alpha.23",
        "react-native-snap-carousel": "^3.8.4",
        "react-native-splash-screen": "^3.2.0",
        "react-native-svg": "^9.13.6",
        "react-native-view-shot": "^3.1.2",
        "react-native-webview": "^9.4.0",
        "react-navigation": "^4.0.2",
        "react-navigation-drawer": "^2.3.3",
        "react-navigation-stack": "^1.10.3",
        "react-redux": "^7.1.3",
        "redux": "^4.0.4",
        "redux-persist": "^6.0.0",
        "redux-thunk": "^2.3.0",
        "rn-fetch-blob": "^0.11.2"
    },
    "devDependencies": {
        "@babel/core": "7.8.4",
        "@babel/runtime": "7.8.4",
        "@react-native-community/eslint-config": "1.1.0",
        "@types/react": "^16.9.46",
        "@types/react-dom": "^16.9.8",
        "babel-jest": "^25.1.0",
        "eslint": "6.7.2",
        "jest": "^25.1.0",
        "metro-react-native-babel-preset": "0.59.0",
        "react-test-renderer": "16.13.1"
    },
    "jest": {
        "preset": "react-native"
    }
}
在@Florin的建议/过程之后,现在有14个构建错误(来自使用
npx react native run ios构建):

**构建失败**

以下生成命令失败: 编译Wift普通x86_64/Users/Desktop/Development/App/node_modules/react native agora/ios/RCTAgora/Base/beanconvertor.swift 编译Wift普通x86_64/Users/Desktop/Development/App/node_modules/react native agora/ios/RCTAgora/Base/Callback.swift 编译Wift普通x86_64/Users/Desktop/Development/App/node_modules/react native agora/ios/RCTAgora/Base/Extensions.swift 编译Wift普通x86_64/Users/Desktop/Development/App/node_modules/react native agora/ios/RCTAgora/Base/MediaObserver.swift 编译Wift普通x86_64/Users/Desktop/Development/App/node_modules/react native agora/ios/RCTAgora/react/PromiseCallback.swift 编译Wift普通x86_64/Users/Desktop/Development/App/node_modules/react native agora/ios/RCTAgora/react/RCTAgoraRtcChannelModule.swift 编译Wift普通x86_64/Users/Desktop/Development/App/node_modules/react native agora/ios/RCTAgora/react/rctagorartcneemodule.swift 编译Wift普通x86_64/Users/Desktop/Development/App/node_modules/react native agora/ios/RCTAgora/react/RCTAgoraRtcSurfaceViewManager.swift 编译Wift普通x86_64/Users/Desktop/Development/App/node_modules/react native agora/ios/RCTAgora/Base/RtcChannel.swift 编译Wift普通x86_64/Users/Desktop/Development/App/node_modules/react native agora/ios/RCTAgora/Base/RtcChannelEvent.swift 编译Wift普通x86_64/Users/Desktop/Development/Slide/Slide/node_modules/react native agora/ios/RCTAgora/Base/rtcnengine.swift 编译Wift普通x86_64/Users/Desktop/Development/App/node_modules/react native agora/ios/RCTAgora/Base/rtcneevent.swift 编译Wift普通x86_64/Users/Desktop/Development/App/node_modules/react native agora/ios/RCTAgora/Base/RtcSurfaceView.swift CompileC/Users/Library/Developer/Xcode/DerivedData/-gdmnlxiprekjqhfiueouiidqhqnl/Build/Intermediates.noindex/Pods.Build/Debug iphonesimulator/RNFirebase.Build/Objects normal/x86_64/rnfirebasemaging.o /用户/Desktop/Development/App/node_modules/react native firebase/ios/RNFirebase/messaging/rnfirebasemsaging.m 普通x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (14次失败)

在粘胶纤维的终端中,完整的构建输出如下所示:

Xcode构建阶段:

大多数时候,当我从console build和Xcode build中获得不同的输出时,我怀疑存在缓存问题,我使用以下步骤来解决该问题:

  • 停止JS服务器
  • r在Xcode中移动派生数据
  • 运行
    pod安装
  • 重新安装节点\u模块(可选)
  • npx watchman watch del all&纱线启动--重置缓存
  • 使用控制台构建和使用Xcode构建
此时,两个命令的输出应该相同。如果你有错误 仔细阅读整个错误消息,有很多机会注意到错误日志中隐藏的模块存在问题

仔细查看错误消息,它看起来与派生数据/缓存或某些未更新的POD相关

如果您仍然遇到问题,请在问题后附上:

  • package.json
    content
  • 完整的错误消息和
  • Xcode->BuildPhases
    
    
    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 'YourRnApp' do
      config = use_native_modules!
    
      use_react_native!(:path => config["reactNativePath"])
    
      target 'YourRnAppTests' do
        inherit! :complete
        # Pods for testing
      end
    
      # Enables Flipper.
      use_flipper!
      post_install do |installer|
        flipper_post_install(installer)
      end
    end
    
    target 'YourRnApp-tvOS' do
      # Pods for RnDiffApp-tvOS
    
      target 'RnDiffApp-tvOSTests' do
        inherit! :search_paths
        # Pods for testing
      end
    end
    
      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 'pokeDex' do
      config = use_native_modules!
    
      use_react_native!(:path => config["reactNativePath"])
    
      target 'pokeDexTests' 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.
      # Important to use at this momemt version 2.30
      use_flipper!({ 'Flipper-Folly' => '2.3.0' })
      post_install do |installer|
          flipper_post_install(installer)
      end
      end
    
      target 'pokeDex-tvOS' do
      # Pods for pokeDex-tvOS
    
      target 'pokeDex-tvOSTests' do
          inherit! :search_paths
          # Pods for testing
      end
      end
    
      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 'pokeDex' do
      config = use_native_modules!
    
      use_react_native!(:path => config["reactNativePath"])
    
      target 'pokeDexTests' do
          inherit! :complete
          # Pods for testing
      end
    
      # Enables Flipper.
      # lines commented
      # 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 'pokeDex-tvOS' do
      # Pods for pokeDex-tvOS
    
      target 'pokeDex-tvOSTests' do
          inherit! :search_paths
          # Pods for testing
      end
      end