-
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
Use of undeclared identifier 'AEPMobileCore' #346
Comments
@jerry7411, we don't have enough information from you to debug what step was missing in the setup. Some quick guide:
It should be able to run the app. If you see error, you can look at the troubleshooting and known issues |
Hi @cacheung , |
Hi @jerry7411 Any error you see other than the undeclared identifier error? |
Hi @jerry7411 , do you have any more info about how to reproduce it? |
Hello @cacheung, I'm experiencing this error as well:
I've followed the steps above and I see the AEM packages in my Pods folder: I can't figure out what I'm missing and been stuck for days, could you please assist me? Thank you! Environment: |
You have an error "Import of C++ module 'Foundation' appears within extern "C" language linkage specification. You might want to fix that first. The libraries can be blocked to import with errors. Seems like you are using expo? We don't officially support expo. We recommend users to use React Native CLI environment to build with Adobe mobile aepsdk-react-native. Our sample app of the AppDelegate.h and AppDelegate.mm files. If you can provide a sample skeleton package, we can debug it, that would be great. |
You're right @cacheung I do think its an issue with expo installer, i created new projects one with Expo and one with React Native Cli and the one with Expo have the same errors as above :( |
@snowiesuet So it works with your React Native Cli setup? |
Hi, one workaround is that you can try to eject the expo app to get the required ios/android files.
npx expo prebuild
You can still run the expo commands to run the app locally. |
@cacheung we have completely the same error, but we use Bare React Native and installed the expo module (expo-image). It's not an option for us to get rid of expo module - any suggestions / workarounds? |
Ok it seems this could help: |
@tr3v3r I haven't got chance to look into the Expo environment closely. Good you found the possible fix. Can you let me know if this solution works after you test it? |
Yes, that works! Instead of initializing directly in AppDelegeate, I've created a separate module and call it in AppDelegate.mm:
AdobeBridge.h #import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
@interface AdobeBridge : NSObject
+ (void)configure: (UIApplicationState)state;
@end AdobeBridge.m #import "AdobeBridge.h"
#import <UIKit/UIKit.h>
@import AEPCore;
@import AEPEdgeIdentity;
@import AEPEdgeConsent;
@import AEPAssurance;
@import AEPEdge;
@import AEPIdentity;
@import AEPLifecycle;
@import AEPSignal;
@import AEPServices;
@import AEPUserProfile;
@import AEPOptimize;
@implementation AdobeBridge
+ (void)configure: (UIApplicationState)appState
{
[AEPMobileCore setLogLevel: AEPLogLevelDebug];
NSArray *extensionsToRegister = @[
AEPMobileEdgeIdentity.class,
AEPMobileEdgeConsent.class,
AEPMobileAssurance.class,
AEPMobileEdge.class,
AEPMobileIdentity.class,
AEPMobileLifecycle.class,
AEPMobileOptimize.class,
AEPMobileSignal.class,
AEPMobileUserProfile.class
];
[AEPMobileCore registerExtensions:extensionsToRegister completion:^{
[AEPMobileCore configureWithAppId: @"KEY"];
if (appState != UIApplicationStateBackground) {
[AEPMobileCore lifecycleStart:@{@"": @""}];
}
}];
}
@end
#import "AdobeBridge.h" // add this import
...
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
...
[AdobeBridge configure: application.applicationState]; // Add this line
return [super application:application didFinishLaunchingWithOptions:launchOptions];
} |
Can you clarify if you are running on an M1 (or M2) macbook. I have attempted to get this working in a project that has been upgraded to RN 72 with Expo SDK 49 but keep running into this error We are a bare RN app with the Expo SDK dependency for a number of native modules and removing the Expo SDK is not an option for us. I need to find a way to get the Adobe code to work with the Expo SDK setups. |
Hello @sdubey01, I use M1 pro max, Xcode 15.3. It seems you have another problem. My issue was connected with the language conflict between adobe sdk and expo sdk as I understand. |
Thanks for clarifying. It at least rules out the M1 architecture as my issue. I will have to try this approach on the older branch I have for RN 70 or 71 to see if it is an issue with the RN 72/Expo 49 configurations. So frustrating that the 'official response' seems to be 'Expo is not supported' with no real effort to sort out why there is a conflict between the two SDK's. The Expo SDK is widely used for native feature access! |
We have the same problem with implementing your library into Expo project. We use expo development client, and we are able to integrate almost everything except your library. |
@cacheung or @yangyansong-adbe - Can you confirm if there is any official statement of support (or no support) for Bare React Native apps that use the Expo SDK for native integrations (like media files, camera, location access, etc.) ? I am supporting an app for a large company migrating from the ACP SDK to the AEP SDK and we are having major issues getting iOS to build. Android seems to build and collect analytics as expected but iOS fails. We are not able to use the suggested '-fcxx-modules' build flag because of the Expo SDK. I also have not been successful in getting the suggested 'alternate solution' of using a separate AdobeBridge.h and AdobeBridge.mm to work in this application as others have posted about. Taking this approach leaves me with a new build error referencing "OBJC_CLASS$_AdobeBridge", referenced from: in AppDelegate.old: symbol(s) not found for architecture x86_64" |
@sdubey01 We are not officially supporting Bare React Native apps that use the Expo SDK at this moment. We are currently in the process of evaluating the scope and details of the work required for this support internally. |
@cacheung what's the workaround or setup process for Expo - managed project? I'm on React Native 0.74.2 and Expo - 51.0.11. We have to keep our application updated to the latest version because of the security vulnerability. |
@sainjay There is currently no official workaround for integrating Expo with the Mobile SDK for React Native, some users have reported success with certain steps mentioned in this thread. I recommend exploring those steps to see if they work for your specific use case. Our team is actively evaluating Expo support requirements. If you need further assistance, consider reaching out to Adobe support via a ticket for Expo-related inquiries. |
Tried this in RN 0.74.2 and Expo 51.0.11, facing the following error: Any suggestions on how to get rid of this error? |
For project using Expo 51, RN 0.74, you can use the following configuration: AppDelegate.h ` #import <ExpoModulesCore/EXAppDelegateWrapper.h> @EnD AppDelegate.mm ` @implementation AppDelegate (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions // You can add your custom initial props in the dictionary below. // Initialize Adobe SDK const UIApplicationState appState = application.applicationState; [AEPMobileCore registerExtensions: @[ return [super application:application didFinishLaunchingWithOptions:launchOptions]; Add the flags as per: #247 This works and builds successfully. Android is also building without issues. |
Prerequisites
Bug summary
Hi guys, I'm trying to implement the latest version of AEP SDK .
I already followed the guidelines and I got this error
I cannot use any classes from AEP SDK even though I already imported according to the guidelines
Environment
Node: 20.12.0
NPM: 10.5.0
Xcode: 15.3
React Native: 0.70.14
React Native AEP SDK: 6.0.0
The text was updated successfully, but these errors were encountered: