react-native-fabric icon indicating copy to clipboard operation
react-native-fabric copied to clipboard

Argument list too long: recursive header expansion failed

Open sandeep-t2s opened this issue 8 years ago • 18 comments

While building below error :

Argument list too long: recursive header expansion failed at /Users/dev/fabric/ignite-drive2success-react/node_modules/react-native-fabric/ios/../../../ios/Pods/React/node_modules/diff/lib/patch.

sandeep-t2s avatar Oct 24 '17 09:10 sandeep-t2s

Have this same problem too, although the offending folder was /ios/Pods/React/node_modules/typedarray/test/server.

How to resolve?

gavin-gmlab avatar Oct 25 '17 03:10 gavin-gmlab

I was having the same problem because I'd installed react-native-fabric as a Pod.

My currently working setup for iOS is the following:

  1. Installed Crashlytics and Fabric through CocoaPods and set them up in Xcode by following the official installation guide. So now my Podfile only has these two entries:
pod 'Fabric'
pod 'Crashlytics'
  1. Installed react-native-fabric through npm with yarn add react-native-fabric.
  2. Then I received an error while compiling:

ld: framework not found Crashlytics

I added $(inherited) to all Framework Search Paths in my project target's Xcode Build Settings as described in this Stackoverflow answer.

tiagoalves avatar Oct 27 '17 10:10 tiagoalves

@tiagoalves , thanks for the tip. Although my solution not exactly the same, cause I already had $(inherited) in the Framework search paths, but removing react-native-fabric from the pod file was the key to the solution.

Had to do the manual steps of adding the node_modules/react-native-fabric/ios/SMXCrashlytics.xcodeproject to the Libraries folder and the libSMXCrashlytics.a to the linked Framework and Libraries in the General tab of the project

gavin-gmlab avatar Oct 31 '17 04:10 gavin-gmlab

For those of you feeling completely lost like I was, I experienced this in updating from 0.4.1 to 0.5.1; not sure where the regression occurred between there, but downgrading is this only thing that resolved the issue (after trying just about everything on StackOverflow).

ArtisanalPickle avatar Dec 03 '17 02:12 ArtisanalPickle

@sandeep-t2s the same appeared in SMXCrashlytics.xcodeproj after I updated xcode. Just removed it and added to Library from node_modules/react-native-fabric/ios/.. I found that it changed the Framework Search Paths to correct path.

MsSterh avatar Feb 05 '18 14:02 MsSterh

Any one the solution did not work for me. Facing the same issue. Argument list too long: recursive header expansion failed at /Users/fari/ReactNativeApps/jem-app/node_modules/react-native-fabric/ios/../../../ios/Pods/boost-for-react-native/boost/numeric/odeint/external/viennacl.

shahwajahat99 avatar Apr 10 '18 10:04 shahwajahat99

I was experiencing this error. Switching to a more recent iPhone version and iOS version for the simulator seemed to fix it

TSMMark avatar Apr 20 '18 15:04 TSMMark

I can confirm this is broken in 1.5.1 but works fine in 1.4.1 . There are two libSMXCrashlytics.a files, one for tvOS. I know I'm linking the proper one. But not sure why this is broken.

tmaly1980 avatar Jul 26 '18 21:07 tmaly1980

There is a pull request for this : #169 But not merged yet :(

chawax avatar Aug 21 '18 14:08 chawax

Followed the manual integration steps again & it worked.

ghost avatar Dec 14 '18 14:12 ghost

Still getting this - latest RN Fabric + latest RN (0.59.1)

oferRounds avatar Mar 18 '19 16:03 oferRounds

Specifically getting: Argument list too long: recursive header expansion failed at {peoject_path}/node_modules/react-native-fabric/ios/../../../ios/build/Index/DataStore/v5/records/IQ.

oferRounds avatar Mar 18 '19 16:03 oferRounds

Ok, a solution that worked for me was to set all the paths on the Header Search Paths to non-recursive

oferRounds avatar Mar 25 '19 07:03 oferRounds

Removing ios/Build resolved this issue for me

shanekoss avatar Mar 27 '19 22:03 shanekoss

FYI I'm not at all familiar with xcode, but some time ago I add this same issue with RNcamera, and this comment on the issue fixed it for me. Tried the same with RNfabric and it seems to fix it.

create a file to be called on postinstall script with the following:

./scripts/fix-rn-ios-search-paths.sh

#!/bin/bash
set -e

# Make RNfabric search paths non-recursive for ios to avoid recursion overflow in build
sed -i -e 's/ios\/\*\*/ios\/\*/g' ./node_modules/react-native-fabric/ios/SMXCrashlytics.xcodeproj/project.pbxproj

echo 'RNfabric paths corrected'

call it on postinstall script:

./package.json

  "scripts": {
     ...
    "postinstall": "./scripts/fix-rn-ios-search-paths.sh"
  },

As the autor said in the comment this should be a temporary fix.

mstrk avatar Jun 10 '19 19:06 mstrk

is there any proper solution for this

agrawalsurabhi89 avatar Dec 03 '19 11:12 agrawalsurabhi89

I temporally fixed it modifying headers path on SMXCrashlytics project.

On xCode you must tap on SMXCrashlytics.xcodeproj, then in the main screen go to: Build settings -> Search Paths -> Header Search Paths

Screen Shot 2019-12-19 at 12 21 25

Then you must replace $(SRCROOT)/../../../ios for $(SRCROOT)/../../ios

Screen Shot 2019-12-19 at 12 24 11

It solves the problem but you will get it again even time you do an dependency installation.

jmtorralvo avatar Dec 19 '19 11:12 jmtorralvo

In my case it happened because i was using deps with cocoapods mixed with normal dependencies linked directly to the project.

I definitively solved it movin react-native-fabric dependency to Podfile.

jmtorralvo avatar Dec 19 '19 12:12 jmtorralvo