且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

参数列表太长:递归头扩展失败

更新时间:2023-12-04 19:56:46

我遇到了类似的问题,不得不进入并删除一些标题搜索路径,如下所述:

I have a React Native application that did compile absolutely fine.

After installing react-native-sentry and automatically linking via react-native link, I am faced with this problem:

Showing Recent Issues
Argument list too long: recursive header expansion failed at /Users/dan/Sites/app/node_modules/react-native-intercom/iOS/../../../ios/Pods/React/node_modules/exit-hook.

This error occurred after I ran pod install

Podfile

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

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

  # Pods for app
  pod 'AppCenterReactNativeShared', '~> 1.4.0'
  pod 'SentryReactNative', :path => '../node_modules/react-native-sentry'

  platform :ios, '9.0'

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

end

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

  # Pods for app-tvOS

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

end

I've not modified the RNIntercom project at all, this problem always occurs after I try to install a new library via cocoa.

I ran into a similar issue and had to go in and remove a few header search paths, as described here:

https://facebook.github.io/react-native/docs/0.60/troubleshooting#argument-list-too-long-recursive-header-expansion-failed

Argument list too long: recursive header expansion failed

In the project's build settings, User Search Header Paths and Header Search Paths are two configs that specify where Xcode should look for #import header files specified in the code. For Pods, CocoaPods uses a default array of specific folders to look in. Verify that this particular config is not overwritten, and that none of the folders configured are too large. If one of the folders is a large folder, Xcode will attempt to recursively search the entire directory and throw above error at some point.

To revert the User Search Header Paths and Header Search Paths build settings to their defaults set by CocoaPods - select the entry in the Build Settings panel, and hit delete. It will remove the custom override and return to the CocoaPod defaults.