找不到'React/RCTUtils.h'文件 [英] 'React/RCTUtils.h' file not found

查看:117
本文介绍了找不到'React/RCTUtils.h'文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用xcode来构建android应用.在天蓝色的devops管道中;在构建时,我收到此错误:

I am using xcode to build android app. in azure devops pipeline; on build i am getting this error:

▸ Compiling PdfManager.m

❌  /Users/runner/runners/2.166.3/work/1/s/node_modules/react-native-pdf/ios/RCTPdf/PdfManager.m:16:9: 'React/RCTUtils.h' file not found

#import "React/RCTUtils.h"
                                       ^~~~~~~~~~~


▸ Compiling RCTPdfPageViewManager.m
▸ Compiling RCTPdfPageView.m
▸ Compiling RCTPdfView.m
** BUILD FAILED **


The following build commands failed:
    CompileC /Users/runner/Library/Developer/Xcode/DerivedData/helloapp-awmfiqdyvoywmpfazxztxqjlmzar/Build/Intermediates.noindex/Pods.build/Release-iphoneos/react-native-pdf.build/Objects-normal/armv7/PdfManager.o /Users/runner/runners/2.166.3/work/1/s/node_modules/react-native-pdf/ios/RCTPdf/PdfManager.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
##[error]Error: /usr/bin/xcodebuild failed with return code: 65

找不到原因,需要一些帮助,我的Podfile是:

Unable to find cause of this, need some help, my podfile is:

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

target 'helloapp' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for helloapp
   pod 'Firebase/Core'
   pod 'Firebase/Messaging' 

 pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'

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


 target 'helloappTests' do
    inherit! :search_paths
    # Pods for testing
  end

end
post_install do |installer|
        installer.pods_project.build_configurations.each do |config|
            config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
            config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
        end
end

和我的azure管道Yaml任务,在这里,我使用cocoapods安装了吊舱:

and my azure pipeline yaml tasks, in this i have installes pods using cocoapods:

trigger:
- master

pool:
  vmImage: 'macos-latest'

variables:
  - group: abcd

steps:
- task: NodeTool@0
  inputs:
    versionSpec: '9.7.1'
  displayName: 'Install Node'
- script: npm install
  displayName: 'Install dependencies'

- task: InstallAppleCertificate@2
  inputs:
   certSecureFile: '$(file)'
   certPwd: '$(Pass)'
   keychain: 'temp'
   deleteCert: true  

- task: InstallAppleProvisioningProfile@1
  inputs:
   provisioningProfileLocation: ''
   provProfileSecureFile: '$(provisioningProfile)'
   removeProfile: true

- task: Cache@2
  inputs:
   key: 'pods | "$(Agent.OS)" | Podfile.lock'
   path: 'pods'
- task: CocoaPods@0
  inputs:
    forceRepoUpdate: true
    projectDirectory: '$(system.defaultWorkingDirectory)'
  displayName: 'pod install using the CocoaPods'

- task: Xcode@5
  inputs:
    workingDirectory: 'ios'
    actions: 'build'
    scheme: 'helloapp'
    sdk: 'iphoneos'
    configuration: 'Release'
    xcWorkspacePath: '**/helloapp.xcworkspace'
    xcodeVersion: 'default'
    packageApp: true
    signingOption: 'manual'
    signingIdentity: '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)'
    provisioningProfileUuid: '$(APPLE_PROV_PROFILE_UUID)'
    args: '-UseModernBuildSystem=0'

- task: CopyFiles@2
  displayName: 'Copy Files to: $(build.artifactStagingDirectory)'
  inputs:
    SourceFolder: ''
    contents: '**/*.ipa'
    targetFolder: '$(build.artifactStagingDirectory)'
    overWrite: true

- task: PublishBuildArtifacts@1
  inputs:
    pathtoPublish: '$(build.ArtifactStagingDirectory)'
    artifactName: 'drop' 
    publishLocation: 'Container'

pod安装任务输出,即通过cocoapods添加以安装Pod的任务的日志:

pod installation task output i.e. log for the task added to install pods by cocoapods:

Version      : 0.151.1
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/package/cocoapods
==============================================================================
/usr/local/lib/ruby/gems/2.6.0/bin/pod --version
1.9.1
/usr/local/lib/ruby/gems/2.6.0/bin/pod install --repo-update --project-directory=/Users/runner/runners/2.166.3/work/1/s/ios
Updating local specs repositories
Adding spec repo `trunk` with CDN `https://cdn.cocoapods.org/`
Analyzing dependencies
Downloading dependencies
Installing React (0.11.0)
Installing react-native-pdf (5.0.12)
Installing rn-fetch-blob (0.10.6)
Generating Pods project
Integrating client project
Pod installation complete! There are 5 dependencies from the Podfile and 14 total pods installed.

[!] Automatically assigning platform `iOS` with version `9.0` on target `helloapp` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

[!] The `helloappTests [Debug]` target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods-helloappTests/Pods-helloapp.debug.xcconfig'. This can lead to problems with the CocoaPods installation

[!] The `helloappTests [Release]` target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods-helloappTests/Pods-helloappTests.release.xcconfig'. This can lead to problems with the CocoaPods installation

[!] React has been deprecated
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.
Finishing: pod install using the CocoaPods

如果需要更多详细信息,请在评论中提问.

if require any more details please ask in comments.

推荐答案

您提供的Podfile缺少对自身进行反应的引用,这是一个如何解决它的示例(注释中使用react-native版本0.58) :

The podfile you provided is missing the reference to react itself, here is one example of how you can fix it (with react-native version 0.58 from the comments):

target 'helloapp' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # START REACT_NATIVE DEPENDENCIES
  pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'Core',
    'CxxBridge',
    'RCTActionSheet',
    'RCTAnimation',
    'RCTGeolocation',
    'RCTImage',
    'RCTLinkingIOS',
    'RCTNetwork',
    'RCTSettings',
    'RCTText',
    'RCTVibration',
    'RCTWebSocket',
    'RCTPushNotification',
    'DevSupport'
  ]
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga/Yoga.podspec'
  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/GLog.podspec'
    # END REACT_NATIVE DEPENDENCIES

  # Pods for helloapp
   pod 'Firebase/Core'
   pod 'Firebase/Messaging' 

 pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'

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


 target 'helloappTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

这篇关于找不到'React/RCTUtils.h'文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆