plaid / react-native-plaid-link-sdk

Plaid Link for React Native
MIT License
171 stars 120 forks source link

declaration of 'RCTEventEmitter' must be imported from module 'React.RCTEventEmitter' before it is required #675

Closed beqramo closed 1 month ago

beqramo commented 4 months ago

The problem

I found almost similar issue already but I don't know exactly the solution from there: https://github.com/plaid/react-native-plaid-link-sdk/issues/436

screenshot:

image

error

āŒ  /Users/builder/clone/ios/Pods/Headers/Private/react-native-plaid-link-sdk/react_native_plaid_link_sdk/RNLinksdk.h:9:24: declaration of 'RCTEventEmitter' must be imported from module 'React.RCTEventEmitter' before it is required

Environment

Plaid Link React Native 11.10.2
ReactNative Version 0.71.14
Xcode 15.3
Pod 1.14.2
Occurs on iOS yes

Steps to Reproduce

install and try to run archive on ios for the release, it will throw this error

dtroupe-plaid commented 3 months ago

Hi @beqramo,

I just tested archiving for iOS in our example app and I did not receive this error.

Additionally, the linked issue is related to Expo which is not supported. Are you using a detached Expo setup or Expo at all?

beqramo commented 3 months ago

I'm not using expo. you tried with the above versions?

thanks

dtroupe-plaid commented 3 months ago

I updated the example app to 11.11.0 the import in the file has not changed so I don't believe the minor version difference is relevant. You could try changing it to #import <React/RCTEventEmitter.h> to see if that resolves the issue, but I didn't need to do that to archive.

beqramo commented 3 months ago

Okay I will try it again

beqramo commented 2 months ago

Hi, I tried many things, but without any success, it is always throws a similar error:

error: could not build Objective-C module 'react_native_plaid_link_sdk'

Are you sure you have installed this package on react native 0.71.18?

beqramo commented 2 months ago

@dtroupe-plaid ^ And tried to archive it for prod?

dtroupe-plaid commented 2 months ago

Hi @beqramo

I created a blank RN project using the following:

  1. npx @react-native-community/cli@latest init Issue675 --version 0.71.18
  2. npm install --save react-native-plaid-link-sdk
  3. Change min supported iOS version to 14.0 (required for V11)
  4. Add Plaid views from example app.

The project builds and archives without issue on Xcode 15.3. I've attached a copy here, you'll need to run npm install and pod install in the ios directory before testing.

Please let me know what you experience in your testing šŸ™

Issue675.zip

dtroupe-plaid commented 2 months ago

@beqramo another tip that might be helpful is to point out that you can modify the file in question in Xcode:

Screenshot 2024-07-25 at 13 39 01

Perhaps changing something with the imports might help? Let me know if you find anything.

dtroupe-plaid commented 2 months ago

@beqramo Can you provide an update? If not I am going to close the issue šŸ™

beqramo commented 2 months ago

Hi, sorry.

I will provide update for tomorrow. Thanks

beqramo commented 1 month ago

I have just updated the 10th version to its up-to-date version which I think has the fix for our issue in prod. For now we will stick to that version. we don't have enough resources to spend time on this issue again.

Just to know when you will support the 10th version of the SDK?

thanks

dtroupe-plaid commented 1 month ago

I have just updated the 10th version to its up-to-date version

Sorry, it's unclear to me what version you're now using. Can you be specific (list the full version) so I can see if there are relevant changes with regards to this issue?

Just to know when you will support the 10th version of the SDK?

Sorry, again I am not sure what version you're talking about? V10.x.x?

beqramo commented 1 month ago

Oh, my bad, I just read my message again...

We are using the 10th version of the SDK in general. Now, I have updated it to the latest version: 10.13.2. From the release notes, I see that you fixed the OAuth bug, which I believe we were also experiencing in production.

Since we don't have enough resources to spend more time on this issue for now, I think this update will be sufficient for us.

Another question was about: Till when are you going to support the 10th version of the SDK?

Thanks and sorry for misunderstanding

dtroupe-plaid commented 1 month ago

V10.x.x will likely no longer receive updates once V12 is officially released (EOY target) this doesn't mean you can't keep using it, but it means it will no longer receive updates.

Looking at the diff between 10.13.2 and 11.11.2 the changes to RNLinksdk.h do include this import but it looks like #import <React/RCTEventEmitter.h> was changed to #import "RCTEventEmitter.h" I suggested making this change in a previous comment and I am assuming it didn't work?

However, that appears to be the only explanation here.

Screenshot 2024-08-07 at 10 35 54

I am going to close this issue. Feel free to post if anything changes.

beqramo commented 1 week ago

Hi @dtroupe-plaid,

Inserting the old code into RNLinksdk.h resolved the issue. Thank you for your help!

Iā€™m not entirely sure what caused the problem, but I think it would be worth investigating on your end.

Just to confirm: this solution will not create other issues with the new v11 right, correct? FYI Iā€™m not using the new architecture.

Thanks again!