react-native-app-auth: Argument list too long: recursive header expansion failed
After integrating react-native-app-auth with our project, our iOS build is now failing with the following error:
Check dependencies
Argument list too long: recursive header expansion failed at /Users/username/app_name/node_modules/react-native-app-auth/ios/../../../ios/build/Index/DataStore/v5/records/UW.
The problem seems to be the result of an overly aggressive HEADER_SEARCH_PATHS build setting causing Xcode to give up after it recurses through too many sub-directories for RNAppAuth’s required header files. Other react native libraries have similar issues reported, and have resolved the issue by modifying HEADER_SEARCH_PATHS to be more specific than the current $(PROJECT_DIR)/../../../ios/**
I tried setting the HEADER_SEARCH_PATHS to $(PROJECT_DIR)/../../../ios/Pods/**
but that produced other build errors.
Other libraries with similar problems: https://github.com/react-native-community/react-native-camera/issues/1407 https://github.com/Microsoft/AppCenter-SDK-React-Native/issues/209
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 21 (6 by maintainers)
This should finally be fixed in
v3.0.2
. Please let me know is the problem persists.Hi all, I have fixed this issue for changeng HEADER_SEARCH_PATHS from “$(SRCROOT)/…/…/…/ios/**” to “$(SRCROOT)/…/…/…/ios/Pods/Headers/Public”, “$(SRCROOT)/…/…/…/ios/{rootProjectName}”,
We have main issue with rootProjectName becouse it depends on appDelegate. I have found next line appDelegate.currentAuthorizationFlow = …
I have created the branch with a possible fix. Please check https://github.com/laktarugar/react-native-app-auth/tree/fix/recursive_header
For us, there was a conflict with some of the other installed pods. Had to edit header search paths, but also had to make sure not to include whole pods folder or it would use the headers from other pods which would cause the build to fail. Right now we have to reference the project folder directly by name, not sure if there is a generic solution that would work for everyone which could be merged.
Working search paths for us in RNAppAuth.xcodeproj set like below, replace “yourProjectName” with your project name.
$(inherited) /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include $(SRCROOT)/…/…/…/React $(SRCROOT)/…/…/react-native/React $(SRCROOT)/…/…/…/ios/Pods/AppAuth $(SRCROOT)/…/…/…/ios/Pods/Headers $(SRCROOT)/…/…/…/ios/yourProjectName
I’m having this same issue trying to use the library for the first time, and rolling back to 2.4.0 doesn’t seem to fix it.
Is there any straightforward way to get it running for the time being?
@kadikraman Unfortunately 3.0.0 does not resolve the issue, it is still reporting header expansion failed at
react-native-app-auth/ios/../../../ios/DerivedData/<app>/Index/DataStore/v5/record/6W
Running react native 0.56.0Downgrading to v2.4.0 fixed this error for me. This commit specifically breaks the import in our build and causes the “fatal error: ‘AppAuth/AppAuth.h’ file not found #import <AppAuth/AppAuth.h>”. in RNAppAuth.m Line 3 error.
https://github.com/FormidableLabs/react-native-app-auth/commit/2f714cb5cf5fcf5da2d0d26b6ced0689a2ccda04#diff-9d58d422456571f1c785f3ec104e859d