No visible @interface for 'EXAppDelegateWrapper' declares the selector 'application:openURL:options:'

435 Views Asked by At

I am upgrading an Expo app from react native 0.63 to 0.71 and am running into this error in my AppDelegate.m file.

// Linking API
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
  // error below
  return [super application:application openURL:url options:options] || [RCTLinkingManager application:application openURL:url options:options];
}

// Universal Links
- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {
  BOOL result = [RCTLinkingManager application:application continueUserActivity:userActivity restorationHandler:restorationHandler];
  return [super application:application continueUserActivity:userActivity restorationHandler:restorationHandler] || result;
}

@end

I am not very familiar with objective c so I am unsure how to solve this issue. The error is occurring on the line below the comment "error below" and the error is as follows

No visible @interface for 'EXAppDelegateWrapper' declares the selector 'application:openURL:options:'

1

There are 1 best solutions below

0
AnthonyJ On

Have you tried renaming your AppDelegate.m (one "m") file to AppDelegate.mm (two "m"s) inside xcode?

I had a similar error when upgrading from React Native 0.68.2 to 0.70.8 and Expo 46 to 47:

no visible @interface for 'EXAppDelegateWrapper' declares the selector 'application:didFinishLaunchingWithOptions:'

Renaming my AppDelegate.m file to .mm did the trick.

The main difference between the two file extensions is that AppDelegate.mm allows you to include Objective-C, C++ or Objective-C++, but AppDelegate.m only allows Objective-C code.

It's likely that EXAppDelegateWrapper (which comes from expo-modules-core) was updated to include C++ or ObjectiveC++, which is why building with an AppDelegate.m file failed in my case.