-
Notifications
You must be signed in to change notification settings - Fork 31
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
RCTAEPCore is undefined #313
Comments
You followed this Have you |
Hi. Yes, I did follow the instructions in the links you sent - added the configurations in both AppDelegate.h and AppDelegate.mm and imported the package the way as you mentioned. I got the error on both M1 and M2 Mac laptops. Meanwhile, I am able to run the sample app without any error. |
You need to add import { MobileCore } from '@adobe/react-native-aepcore' to your React Native side of the code, not on the Native platform code. Did you do that? |
Yes, I imported the package in a tsx view file, just like the sample app. |
Is it possible to share your sample project, we can take a look? |
Sure, that would be really helpful. I created a new repo using react-native-cli (https://github.com/Issactoto/adobe-analytics-test/tree/main). I just changed all the files accordingly as mentioned above and the function is used in App.tsx. I am using Yarn and IOS 17.2 for your information. Thanks! |
@Issactoto
Please give them a try and see if you can build. |
Thank you very much for the reply and solution. It works for the new repo I shared earlier. However, I am actually using a monorepo for the project I am developing and I am still facing the same error. Unfortunately, I am unable to share the code here. Do you happen to know if there are any specific changes that need to be made in this context? Additionally, I want to note that I don't experience any problems when running the code on Android. |
For the original log, we thought it is possible due to the import statement in the react native side.
But it seems like you have that correctly in the sample app you shared. If using the same react native code and Android platform is working, then the issue is on the iOS side. |
Yes, I think there were some errors on the Xcode native platform. I got it sorted now, thank you very much for your help! |
Expected Behaviour
Both Android and IOS device run without error
Actual Behaviour
IOS device runs with error saying that RCTAEPCore is undefined.
Reproduce Scenario (including but not limited to)
Run React Native in IOS device
Steps to Reproduce
react-native: 0.72.6
@adobe/react-native-aepcore: ^5.0.0
Yarn/pnpm
Followed all the steps for IOS and Android documented on the readme.
Platform and Version
Mac M2
Sample Code that illustrates the problem
MobileCore.collectPii({ myPii: 'data' });
Logs taken while reproducing problem
I wonder if there is any configuration for IOS missing on the readme. Thank you very much for your help!
The text was updated successfully, but these errors were encountered: