Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Argument list too long: recursive header expansion failed #294

Closed
vsrboth opened this issue Aug 1, 2017 · 45 comments
Closed

Argument list too long: recursive header expansion failed #294

vsrboth opened this issue Aug 1, 2017 · 45 comments

Comments

@vsrboth
Copy link

vsrboth commented Aug 1, 2017

I keep having this error no matter after installing react-native-firebase

Argument list too long: recursive header expansion failed at /var/www/upwork/bus5app/node_modules/react-native-fbsdk/ios/../../../ios/Pods/React/node_modules/vinyl-fs/node_modules/through2.

Also there is another issue as well:

This warning is caused by a @providesModule declaration with the same name across two different files.
jest-haste-map: @providesModule naming collision:
  Duplicate module name: ActionSheetIOS
  Paths: /private/var/www/upwork/bus5app/ios/Pods/React/Libraries/ActionSheetIOS/ActionSheetIOS.js collides with /private/var/www/upwork/bus5app/node_modules/react-native/Libraries/ActionSheetIOS/ActionSheetIOS.js

(Please write your issue here along with the environment details below. Include any key files which will help us to debug, such as your Podfile and/or app/build.gradle file).

Environment

  1. Target Platform (e.g. iOS, Android): iOS
  2. Development Operating System (e.g. macOS Sierra, Windows 10): macOS Sierra
  3. Build tools (Xcode or Android Studio version, iOS or Android SDK version, if relevant): Xcode
  4. React Native version (e.g. 0.45.1): ^0.46.2
  5. RNFirebase Version (e.g. 2.0.2): ^2.0.4
  6. "react-native-fbsdk": "^0.6.0"
@vsrboth vsrboth changed the title Argument list too long: recursive header expansion failed at /var/www/upwork/bus5app/node_modules/react-native-fbsdk/ios/../../../ios/Pods/React/node_modules/vinyl-fs/node_modules/through2. Argument list too long: recursive header expansion failed Aug 1, 2017
@Ehesp
Copy link
Member

Ehesp commented Aug 1, 2017

Please check your Header paths in xCode, there seems to be an issue with the paths which are being set.

@ohtangza
Copy link

ohtangza commented Aug 1, 2017

I am experiencing this issue too after migrating from 1.x to 2.0.5.

@chrisbianca
Copy link
Contributor

@vsrboth Have you installed react-native-fbsdk as a pod or by linking the library manually?
@ohtangza Are you using react-native-fbsdk too? Same questions applies if so?

  1. If installed and linking manually, I would suggest adding the FBSDK and react-native-fbsdk pods like so:
  pod 'FBSDKCoreKit'
  pod 'react-native-fbsdk', :path => '../node_modules/react-native-fbsdk/ios'

And remove the manual linking.

  1. If installed as a pod, then you need to check that the library isn't also linked manually and remove that manual link

@vsrboth
Copy link
Author

vsrboth commented Aug 2, 2017

I'm not too sure with the problem, but seems like we need to add the following to the pod file

pod "Yoga", :path => "../node_modules/react-native/ReactCommon/yoga"
pod 'React', :path => '../node_modules/react-native', :subspecs => [
  'BatchedBridge', # Required For React Native 0.45.0+
  'Core',
  # Add any other subspecs you want to use in your project
]

Then everything is working fine without any track of error or duplication anymore.
Hope this help anyone.

@chrisbianca
Copy link
Contributor

@vsrboth This is already part of the installation instructions: http://invertase.io/react-native-firebase/#/installation-ios?id=_21-add-the-required-pods

@vsrboth
Copy link
Author

vsrboth commented Aug 3, 2017

it would be great to update the source to specifically tell developer to add that into the pod file.

@Ehesp
Copy link
Member

Ehesp commented Aug 3, 2017

@vsrboth what do you mean by the source?

@vsrboth
Copy link
Author

vsrboth commented Aug 3, 2017

@Ehesp Sorry for my typo. I mean it would be great to mention directly in the instruction http://invertase.io/react-native-firebase/#/installation-ios?id=_21-add-the-required-pods.

@chrisbianca
Copy link
Contributor

@vsrboth It does already say to add React and Yoga if you do not already have them as pods

@vsrboth
Copy link
Author

vsrboth commented Aug 3, 2017

@chrisbianca It's a bit confusing to me. React should already be available in my project package.json. Therefore, I'm not too sure why I need to add React to the pods.

Sorry if I'm being non-sense here (bow)

@chrisbianca
Copy link
Contributor

I have updated the wording to read:

If you do not already have React and Yoga installed as pods, then add Yoga and React to your `Podfile` as follows

@vsrboth
Copy link
Author

vsrboth commented Aug 3, 2017

@chrisbianca Thank you so much. It's very understandable now comparing to the previous text

if you are **new to Cocoapods** or do not already have React installed as a pod, then add Yoga and React to your Podfile as follows:

@ohtangza
Copy link

ohtangza commented Aug 3, 2017

I fixed my problem. In my case, I already have React in my Xcode project and added React in Pod again. In my case, after removing Xcode's Derived Data, it works.

@paranat9221
Copy link

@vsrboth I try to add yoga and react like you but I can't fix my problem, Can you explain me more how you fixed this

thank :)

@BIWhitfield
Copy link

I have the code provided by @vsrboth on the 2nd of August in my PodFile and still get the error...

@bsevindi
Copy link

Same problem when I want to run my application via Xcode. Error message is:

Argument list too long: recursive header expansion failed at /Users/bsevindi/Desktop/projects/aracqr/node_modules/react-native-firebase/ios/../../../ios/Pods/React/node_modules/yeoman-generator/node_modules/inquirer/lib.

My development environment is:
react-native-cli: 2.0.1
react-native: 0.52.0
react-native-firebase: ^3.2.2
Xcode Version 9.2 (9C40b)
macOS High Siearra 10.13.2 (17C205)

@matyasfodor
Copy link

@inventrix I have the same issue, I can confirm this bug

@bsevindi
Copy link

@matyasfodor, in my case I got "Argument list too long" after running "pod update". So I revert the changes that pod update made and the problem disappeared.

@matyasfodor
Copy link

@inventrix I managed to solve it by removing React from ios/Pods.

@tirrorex
Copy link

tirrorex commented Jan 23, 2018

Same here, also can't find the related documentation (about setting react and yoga in the podfile)
https://rnfirebase.io/docs/v3.2.x/installation/ios

Did some digging, the error is coming from framework search paths in the build settings of the library :
"${SRCROOT}/../../../ios/Pods" recursive

Problem is some users might need it depending on how they install dependencies.
Why not use $(PODS_ROOT) instead?

@tirrorex
Copy link

@chrisbianca a quick fix that worked for me was to replace
${SRCROOT}/../../../ios/Pods/Headers/Public
by
"${SRCROOT}/../../../ios/Pods/Headers/Public/FirebaseCore" recursive

@Luckygirlllll
Copy link

@tirrorex Where did you make this replacement?

@tirrorex
Copy link

tirrorex commented Feb 2, 2018

Headers search path in the library build settings, but FirebaseCore is not enough.
If you want to use other features you will have to do that for EVERY firebase component you need.
But this should be fixed in the last release as i didn't have any issue when recloning my project so...

@Luckygirlllll
Copy link

@tirrorex I'm facing this issue with react-native-fcm

@tirrorex
Copy link

tirrorex commented Feb 2, 2018

@Luckygirlllll it should be the same.
If you're facing this issue it's probably because some of your libraries are using cocoapods when the other do not.
It can be tricky but changing the paths for headers search path and framework search path should fix your issue.

@egunsoma
Copy link

Does replacing Header Search Paths really solves this issue? Anyone can confirm?

@tirrorex
Copy link

It's a workaround and i wouldn't use that if you don't know what you are doing, because chances are you will need to add more paths to Header Search Paths after replacing the one provided.

@paperview
Copy link

I have the same bug, headers do nothing for me

@tirrorex
Copy link

@paperview did you delete the path that was causing the error? the all point of the workaround it to replace it with something that won't trigger the error

@ethanyuwang
Copy link

@tirrorex I tried the replacing and still have the same error

@ethanyuwang
Copy link

@chrisbianca this link (http://invertase.io/react-native-firebase/#/installation-ios?id=_21-add-the-required-pods) just takes me to the homepage. Where can I see this instruction?

@ethanyuwang
Copy link

still having the same problem by changing podfile to:

  pod "yoga", :path => "../node_modules/react-native/ReactCommon/yoga"

  pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'BatchedBridge', # Required For React Native 0.45.0+
    'Core',
  ]

@kidequinox
Copy link

My issue was that various pods were using different versions of React. I needed a unified reference. Auto-removing them in the podfile fixed this issue and others.

target <yourTarget> do
 pod "yoga", :path => "../node_modules/react-native/ReactCommon/yoga"
 pod 'React', :path => '../node_modules/react-native', :subspecs => [
   'BatchedBridge', # Required For React Native 0.45.0+
   'Core',
   # Add any other subspecs you want to use in your project
 ]
end

# Remove React from projects 
post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == "React"
      target.remove_from_project
    end
  end
end

@benevbright
Copy link

I had the same issue and following resolved my issue.

  1. remove ios/Pods by rm -rf ios/Pods.
  2. remove Podfile.lock.
  3. remove lines in Podfile that you didn't add but there is.
  4. pod install

My problem is gone.

@rishabh-pandey-sternx
Copy link

Getting the same Error when using with React-native-contacts

@Kabangi
Copy link

Kabangi commented Apr 9, 2018

Was getting a similar error with a different library. Turns out I had linked a library that was added to podfile directly. Resolved the issue by removing that pod entry and linking the library manually by copying it to Libraries.

@MacKentoch
Copy link

MacKentoch commented Apr 11, 2018

Same issue using lottie (but using v2.5.0 since 2.3.2 had other non related issues).

I have to use pods way since already using pod for Firebase.

As a workaround, manually installing Lottie will be difficult because of embedded framework Lottie.framework that I don't know how to deal with (project is no more a workspace with pod).

@MacKentoch
Copy link

Alright, I fixed it.

My solution was to leave pods only for Firebase (or anything else you are ok with pods) and to manually link Lottie (no pod for it):

Lottie manual link process (v2.5.0: npm i --save lottie-react-native@latest):

  • add these both Lottie libraries (drag and drop from node_modules)

capture d ecran 2018-04-12 a 20 57 48

  • go to tab build settings and filter head (ensure all is basic and combined)

capture d ecran 2018-04-12 a 20 58 15

  • double click on result filtered and add these 2 lines

capture d ecran 2018-04-12 a 20 58 40

  • got to general tab and add linked framework and libraries (for both libraries) and embedded binaries for lottie framework

capture d ecran 2018-04-12 a 20 59 52

@shaikhussian
Copy link

shaikhussian commented Jun 15, 2018

@vsrboth @Ehesp @ohtangza @chrisbianca @paranat9221

i am getting an error like this, can any one please respond how to fix it
Argument list too long: recursive header expansion failed at /Users/nueve/Desktop/waitcheckbackup/node_modules/react-native-firebase-analytics/ios/../../../ios/Pods/React/node_modules/resolve/test/resolver/symlinked.

@jorgifumi
Copy link

For me, this fix all my problems: https://github.com/orta/cocoapods-fix-react-native

@ranjeetsingh92
Copy link

Remove the derived data and set all the header search path as non-recursive and then clean the project.

@ranjeetsingh92
Copy link

Remove the derived data
set all the header search path as non-recursive

@rajeshsmallarc
Copy link

@matyasfodor worked for me.

Thanks

@sturmenta
Copy link

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

@krupa-rn
Copy link

krupa-rn commented Dec 9, 2021

where is ios/build folder, not seen in my project.

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

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

No branches or pull requests