Skip to content
This repository has been archived by the owner on Jun 16, 2023. It is now read-only.

Argument list too long: recursive header expansion failed #1407

Closed
nikolaigeorgie opened this issue Mar 28, 2018 · 44 comments
Closed

Argument list too long: recursive header expansion failed #1407

nikolaigeorgie opened this issue Mar 28, 2018 · 44 comments

Comments

@nikolaigeorgie
Copy link

Which implementation are you using

I'm using RNCamera

Steps to reproduce

  1. following documentation ( npm install react-native-camera --save)
  2. react-native link
  3. Manual link...

Expected behaviour

I get a build fail and see the following

Argument list too long: recursive header expansion failed at /Users/USER/APP/node_modules/react-native-camera/ios/../../../ios/build/Index/DataStore/v5/records/1G.

Actual behaviour

FAILED BUILD

Environment

  • Node.js version: LATEST
  • React Native version: LATEST
  • React Native platform + platform version: iOS 9.0

react-native-camera

Version: "master"

Love react-native-camera? Please consider supporting our collective: 👉 https://opencollective.com/react-native-camera/donate

@jim-at-jibba
Copy link

I am getting the same issue.

Fingers crossed for a quick fix.

Thanks for all your stellar work on this project.

@jim-at-jibba
Copy link

@nikolas7892 I was able to get my project to build by removing the build folder (./ios/build). Hope that is some help.

@jgfidelis
Copy link
Collaborator

@jim-at-jibba did this solve permanently your problem?

@jgfidelis
Copy link
Collaborator

Try to clean the project, restart xcode and build.

@jim-at-jibba
Copy link

@jgfidelis I solved my problem enough to push a build to Testflight. That was the end of the day so we will see this morning 😄

@MaheshNandam
Copy link

MaheshNandam commented Apr 5, 2018

@lwansbrough @jgfidelis,

I have added Pods at frame relative paths and also replace master repo at package.json

but still:
Argument list too long: recursive header expansion failed at ../node_modules/react-native-camera/ios/../../../ios/Pods/React/node_modules/fsevents/node_modules/path-is-absolute.

@MaheshNandam
Copy link

MaheshNandam commented Apr 6, 2018

I solved by replacing "$(SRCROOT)/../../../ios" at both framework search and header search paths with "$(SRCROOT)/../../../ios/Pods/react-native-camera"

and added "React and Yoga" to my pod file, works for me.

pod 'React', :path => '../node_modules/react-native', :subspecs => ['Core']
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

@mypark
Copy link

mypark commented Apr 24, 2018

that didn't do the fix for me - anyone have alternative suggestions on a fix using a manual install instructions?

@MaheshNandam
Copy link

@mypark,

Remove/Uninstall 'react-native-camera' from podfile,

and if Pod target file has 'react-native-camera', remove this as well and try.

@neogeno
Copy link

neogeno commented Apr 26, 2018

Deleting the DerivedData folder manually worked for me

@M1chaelChen
Copy link

Tried deleting build folder and rebuild, also tried deleting DerivedData. Still got this error when building.
Anyone got other solutions to this?

@cihadturhan
Copy link

Same here, it was working fine before I integrated firebase.
Is there anyone using react-native-firebase with react-native-camera here?

@JJMoon
Copy link

JJMoon commented May 8, 2018

I got the same error, after install Carthage module for the first time.
Header expansion failed on Carthage module.

Argument list too long: recursive header expansion failed at /Volumes/Data/Repo/mymodule/node_modules/react-native-camera/ios/../../../ios/Carthage/Checkouts/channel-plugin-ios/Carthage/Checkouts/ReSwift/BuildPhases.

@JJMoon
Copy link

JJMoon commented May 8, 2018

I solved with deleting framework / header search path in camera project.
It works without these paths included. I guess they are necessary during development phase.

@hkxicor
Copy link

hkxicor commented May 17, 2018

Getting the same issue, nothing works for me tried all solutions

@romk1n
Copy link

romk1n commented May 21, 2018

have the same issue, deleting derived directory doesn't help

@chancehudson
Copy link

chancehudson commented May 29, 2018

Hi everyone, I was experiencing this issue on my companies react native project due to recursive search in the Pods directory here: $(SRCROOT)/../../../ios/**

This causes xcode to look through literally every directory in your projects ios directory.

As a temporary fix I've added a postinstall script that executes the following command:

#!/bin/bash
set -e

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

@ccwukong
Copy link

ccwukong commented Jun 12, 2018

I got it fixed after adding $(SRCROOT)/../node_modules/react-native/React in the Header Search Paths in RNCamera project.

@vgeorge
Copy link

vgeorge commented Jun 15, 2018

I had version 0.12.0, then I tried to upgrade to 1.1.4 and got the "Argument list..." error. Tried all solutions in this issue, but only suceeded when I removed all references to RNCamera and RCTCamera in ios/<project_name/project.pbxproj, cleaned up the project and installed using CocoaPods. The related commit is here:

https://github.com/aetrapp/mobile/commit/517716c53ca1dc3a621d038fe94cc013e435a9ff#diff-3ec47061a629b55cd10c7e19ced7f003.

Manual install didn't worked for me, even when I removed Face Dectector reference.

@divsbhalala
Copy link

I had version 0.12.0, then I tried to upgrade to 1.1.4 and got the "Argument list..." error.
i just try ALL above solution but not able to fix it

@sturmenta
Copy link

I deleted the "ios/build" folder and executed "react-native run-ios" and it worked!

@Irrelon
Copy link

Irrelon commented Aug 8, 2018

This happened to me after following the cocoapods based install instructions.

Fixed it by:

  1. Removing all mention of "react-native-camera" from the ./ios/Podfile
  2. Manually adding the RNCamera project to my main project's Libraries folder (in xcode right click on Libraries in the project tree left side, select "Add files to ..." then navigate to your project's node_modules/react-native-camera/ios/ and select the RNCamera project
  3. Go to your project at the top of the project tree and select it, then go to build phases tab and expand the Link Binary With Libraries section, then click the plus and type "cam" the RNCamera.a will show on the list, add that.

Clean project and rebuild.

@abury
Copy link

abury commented Nov 4, 2018

Thanks @dmitry-salnikov for that super handy script!!! That allowed us to build, however we use wixs detox and the detox build was still showing this error. We just updated the script to set the Library Search Paths as well, and all was solved. 🙌

cat "${SRC_FILE}" | grep -A 4 FRAMEWORK_SEARCH_PATHS
cat "${SRC_FILE}" | grep -A 3 HEADER_SEARCH_PATHS
cat "${SRC_FILE}" | grep -A 4 LIBRARY_SEARCH_PATHS

perl -i -p0e 's/FRAMEWORK_SEARCH_PATHS = (.*?);/FRAMEWORK_SEARCH_PATHS = "\$(SRCROOT)\/..\/..\/..\/ios\/Pods\/Headers\/**\/**";/gs' ${SRC_FILE}

perl -i -p0e 's/HEADER_SEARCH_PATHS = (.*?);/HEADER_SEARCH_PATHS = "\$(SRCROOT)\/..\/..\/react-native\/React\/**";/gs' ${SRC_FILE}

perl -i -p0e 's/LIBRARY_SEARCH_PATHS = (.*?);/LIBRARY_SEARCH_PATHS = "\$(SRCROOT)\/..\/..\/..\/ios\/Pods\/Headers\/**\/**";/gs' ${SRC_FILE}

echo "Check after fix:"
cat "${SRC_FILE}" | grep FRAMEWORK_SEARCH_PATHS
cat "${SRC_FILE}" | grep HEADER_SEARCH_PATHS
cat "${SRC_FILE}" | grep LIBRARY_SEARCH_PATHS

@sommesh
Copy link

sommesh commented Nov 16, 2018

@cihadturhan Please let me know have you fixed this issue ..

I'm facing the same issue when integrating firebase ..

@jayb967
Copy link

jayb967 commented Dec 31, 2018

I am also having issue, have firebase installed as well!

grahammcculloch added a commit to appdevdesigns/adroit-mobile that referenced this issue Jan 15, 2019
@prakhar-goel
Copy link

Try react-native link

@n1ru4l
Copy link
Collaborator

n1ru4l commented Jan 17, 2019

@sibelius Can this by fixed by adjusting the RNCamera.xcodeproj in this repository or is there a reason why the search paths are recursive?

@sibelius
Copy link
Collaborator

Maybe we can fix here, but it should work on both normal projects and podfile projects

@isaaclem
Copy link

I tried removed ./ios/Build folder and running command react-native run-ios, it's working fine, build successfully and running on simulator.

Now I switched over to XCODE and build it, I'm hitting the same problem again. Anyone have idea how to deal with it?

@zq513705971
Copy link

I remove the framework search paths values and add header search paths with the path $(SRCROOT)/../../react-native/React & $(SRCROOT)/../../React in the RNCamera.xcodeproj to fix it

@Mohammad-Khalid23
Copy link

This worked for me.
You have to edit your Framework Search Paths of RNCamera.xcodeproj. Go to,

Xcode -> Your Project -> Libraries -> RNCamera.xcodeproj -> Build Settings -> Framework Search Paths
Double click to edit and update value from $(SRCROOT)/../../../ios to $(SRCROOT)/../../ios
If there is both $(SRCROOT)/../../../ios and $(SRCROOT)/../../ios present then remove the first one.

@krewllobster
Copy link

@Mohammad-Khalid23 Thank you for the detailed instructions! This worked for me after manual ios installation (no pods). For anyone browsing this issue for a solution, try Mohammad's solution first as it is dead simple and well explained.

@johanarnor
Copy link

Had a similar issue which was solved by opening (and building) the .xcworkspace file in Xcode (instead of .xcodeproj).

@hansol775
Copy link

@Mohammad-Khalid23 Thank you. this solution is the answer. Don't reset the git often.

@fouad1994
Copy link

I solved by replacing "$(SRCROOT)/../../../ios" at both framework search and header search paths with "$(SRCROOT)/../../../ios/Pods/react-native-camera"

and added "React and Yoga" to my pod file, works for me.

pod 'React', :path => '../node_modules/react-native', :subspecs => ['Core']
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

Where did you do these changes please?

@sibelius
Copy link
Collaborator

sibelius commented Aug 1, 2019

use autolinking with v3

@sibelius sibelius closed this as completed Aug 1, 2019
@fabOnReact
Copy link
Contributor

fabOnReact commented Aug 20, 2019

Where did you do these changes please?

under Search Paths

Screen Shot 2019-08-20 at 22 14 52

@sibelius autolinking did not work and I am using cocoapods

after using the above solution, I had to solve Apple Mach-O Linker error

@gongmingqm10
Copy link

This worked for me.
You have to edit your Framework Search Paths of RNCamera.xcodeproj. Go to,

Xcode -> Your Project -> Libraries -> RNCamera.xcodeproj -> Build Settings -> Framework Search Paths
Double click to edit and update value from $(SRCROOT)/../../../ios to $(SRCROOT)/../../ios
If there is both $(SRCROOT)/../../../ios and $(SRCROOT)/../../ios present then remove the first one.

Works for me. Saved my day. Thanks.

@jamonholmgren
Copy link

Just noting that there's a mention of this issue in the official documentation:

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

@moxspoy
Copy link

moxspoy commented Oct 16, 2019

This worked for me.
You have to edit your Framework Search Paths of RNCamera.xcodeproj. Go to,

Xcode -> Your Project -> Libraries -> RNCamera.xcodeproj -> Build Settings -> Framework Search Paths
Double click to edit and update value from $(SRCROOT)/../../../ios to $(SRCROOT)/../../ios
If there is both $(SRCROOT)/../../../ios and $(SRCROOT)/../../ios present then remove the first one.

in my case, this way works for me. thank you

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests