Hi!
I've just followed the Getting Started Guide, using CocoaPods
I'm getting this error when trying to compile my iOS project:
Argument list too long: recursive header expansion failed at /Users/rafaelribeirocorreia/dev/thunder-js/react-native-ts/node_modules/appcenter/ios/../../../ios/Pods/React/node_modules/mkdirp/node_modules/minimist/test.
Do you have any ideas on how to solve this?
@rafaelcorreiapoli Can you clarify a few things:
(1) Is it a "brownfield" react native app (existing ios app converted to react native)?
(2) Do you link appcenter via react-native link? How do you reference appcenter in your Podfile?
(3) What is the FRAMEWORK_SEARCH_PATHS in your project.pbxproj?
It looks like this issue is caused by the default FRAMEWORK_SEARCH_PATHS sometimes can cause problems when search recursively, and the solution might be a small tweak to the FRAMEWORK_SEARCH_PATHS.
@dhei I also experienced this issue, my own FRAMEWORK_SEARCH_PATHS didn't seem to be the problem but the ones inside RNCrashes, etc (still using the old MobileCenter package).
Changing all paths to [...]ios/Pods made the app compile successfully.
Here is an example of another repo where this solved the issue:
https://github.com/evollu/react-native-firebase-analytics/commit/e8559a2f00eed245a771e5fdea228c8516d86cbd
Edit: After migrating to AppCenter I can confirm this was the same issue there and manually updating the FRAMEWORK_SEARCH_PATHS made it compile.
@Iamsamwhoami I found the explanation of "arguments list too long" error from React Native's troubleshooting guide:
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.
Looks like the root cause is "$(SRCROOT)/../../../ios/**" is not specific enough for FRAMEWORK_SEARCH_PATHS, therefore Xcode gives up when recursively searching a large directory and throws this error.
Thanks for your #211 PR and I will take a look.
cc @rafaelcorreiapoli
I'm still having the same issue with version "^1.2.0" How should I fix it?
Closing as #246 is already tracking that.
Most helpful comment
@dhei I also experienced this issue, my own
FRAMEWORK_SEARCH_PATHSdidn't seem to be the problem but the ones inside RNCrashes, etc (still using the old MobileCenter package).Changing all paths to
[...]ios/Podsmade the app compile successfully.Here is an example of another repo where this solved the issue:
https://github.com/evollu/react-native-firebase-analytics/commit/e8559a2f00eed245a771e5fdea228c8516d86cbd
Edit: After migrating to AppCenter I can confirm this was the same issue there and manually updating the
FRAMEWORK_SEARCH_PATHSmade it compile.