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

React Native New Architecture, bad header import statement #732

Closed
gavinnewcomer opened this issue Dec 2, 2024 · 5 comments
Closed

React Native New Architecture, bad header import statement #732

gavinnewcomer opened this issue Dec 2, 2024 · 5 comments

Comments

@gavinnewcomer
Copy link

The problem

I upgraded our application to React Native 0.76.3 and am getting a build error due to a bad import of the react_native_plaid_link_sdk-Swift.h in the conditional block for the new architecture.

Environment

Plaid Link React Native e.g. 11.13.2
ReactNative Version e.g. 0.76.3
Occurs on iOS e.g. yes
iOS Version e.g. 16
iOS Devices/Emulators e.g. iPhone 14 Pro (Simulator) & iPhone 15 Pro
Link Session ID n/a

Steps to Reproduce

Try and build a react native iOS app running 0.76.3 and 11.13.2 using Xcode and you will get the build error.

Screenshots

Screenshot 2024-12-01 at 4 49 12 PM

Code

Removing the conditional and import around the line in question resolves the issue.

#import <folly/dynamic.h>
#import <objc/runtime.h>

#if __has_include(<rnplaidlink/react_native_plaid_link_sdk-Swift.h>)
#import <rnplaidlink/react_native_plaid_link_sdk-Swift.h>
#else
#ifdef USE_FRAMEWORKS
#import <react_native_plaid_link_sdk/react_native_plaid_link_sdk-Swift.h>
#else
#import <react_native_plaid_link_sdk-Swift.h>
#endif
#endif
@jessethouin
Copy link

I also ran into this issue. Downgrading to 11.13.1 solved the problem, but yeah this should be addressed.

@dtroupe-plaid
Copy link
Collaborator

Hey @gavinnewcomer & @jessethouin just want to confirm you're saying that removing

#ifdef RCT_NEW_ARCH_ENABLED
#import <react_native_plaid_link_sdk/react_native_plaid_link_sdk-Swift.h>
#else

from ios/PLKFabricHelpers.h resolves the issue?

The reason I am asking this is because this issue was reporting that without that line the SDK didn't compile on 0.76.1 so these lines was explicitly added to resolve that. It now appears that this lines are causing this issue 🤔

I am going to test on 0.76.3 and 0.76.1 hopefully this is something we can resolve across all versions of React Native

@jessethouin
Copy link

My mistake, I'm actually using 11.13.0 with RN 0.76.3, which works well. I haven't tried 11.13.1.

@gavinnewcomer
Copy link
Author

Hey @gavinnewcomer & @jessethouin just want to confirm you're saying that removing


#ifdef RCT_NEW_ARCH_ENABLED

#import <react_native_plaid_link_sdk/react_native_plaid_link_sdk-Swift.h>

#else

from ios/PLKFabricHelpers.h resolves the issue?

The reason I am asking this is because this issue was reporting that without that line the SDK didn't compile on 0.76.1 so these lines was explicitly added to resolve that. It now appears that this lines are causing this issue 🤔

I am going to test on 0.76.3 and 0.76.1 hopefully this is something we can resolve across all versions of React Native

Hey! Yes removing those lines allowed the app to compile on 0.76.3 but if those lines are present and you have the new architecture enabled the compilation fails.

@dtroupe-plaid
Copy link
Collaborator

I am going to push a release to fix this momentarily. For future reference please follow up in #713 I provided additional context there so I will close this issue.

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

3 participants