Файл 'React / RCTUtils.h' не найден - PullRequest
0 голосов
/ 22 апреля 2020

Я использую xcode для создания android приложения. в azure devops конвейере; При сборке я получаю эту ошибку:

▸ 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

Невозможно найти причину этого, нужна помощь, мой подфайл:

# 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:

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, т.е. журнал для задачи, добавленной для установки pod кокосовыми модулями:

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

, если требуется более подробная информация, пожалуйста, спросите в комментариях.

1 Ответ

0 голосов
/ 27 апреля 2020

В подфайле, который вы указали, отсутствует ссылка на самореакцию, вот один пример того, как вы можете это исправить (с комментарием-версией 0.58 из комментариев):

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

...