Can't build project with GoogleSignIn, bare workflow

I’m using the bare workflow with a vanilla RN app that already had some expo dependencies (expo-contacts, expo-calendar) that built successfully. I wanted to add GoogleSignIn. I followed the steps in the docs to set it up using both the docs and the linked blog post. I’m fairly certain I did everything according to instructions.

When I go to build my project, I get several errors. I’m not very familiar with Obj-C, but I think the worst error that this may be stemming from is 'UMCore/UMAppDelegateWrapper.h' file not found. Many of them relate to GIDSignIn, saying things like “No visible @interface for GIDSignIn declares the selector ‘hasPreviousSignIn’”. I’ve attached a screenshot of the summary of errors.

I’m not sure why it wouldn’t be finding UMAppDelegateWrapper.h, so if anyone could help take a look I’d appreciate it. I’m genuinely unsure if this is my error or GoogleSignIn’s.

Edit: To debug the UMAppDelegateWrapper.h issue, I upgraded react-native-unimodules with yarn:

-    "react-native-unimodules": "^0.3.1",
+    "react-native-unimodules": "^0.7.0-rc.1",

and removed Podfile.lock and the Pods directory and re-ran pod install.

This did fix the UMAppDelegateWrapper.h issue, but the other four errors remain.

Update: I “solved” (I hope!) the problem with two steps.

First, I noticed that several of the errors related to changes made in GoogleSignIn 5.0.0, so I added pod 'GoogleSignIn', '~> 5.0.0' to my Podfile. I noticed the PodSpec for expo-google-sign-in didn’t specify a version.

This got rid of the google sign-in related errors, but then I had an error in AppDelegate.m, in this code that the unimodules readme had previously instructed me to add:

- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge
{
    NSArray<id<RCTBridgeModule>> *extraModules = [_moduleRegistryAdapter extraModulesForBridge:bridge andExperience:nil];
    // If you'd like to export some custom RCTBridgeModules that are not Expo modules, add them here!
    return extraModules;
}

XCode complained that “No visible interface for UMModuleRegistryAdapter declares the selector extraModulesForBridge:andExperience”. Searching through the expo code I found extraModulesForBridge but not mention of andExperience besides the README… so on a guess I just tried removing andExperience:nil and it works? My project builds now.

I have no idea what went wrong in the first place, but if it’s now incorrect to have andExperience:nil in AppDelegate.m, it should probably be removed from the react-native-adapter README.

1 Like

Glad you got things sorted out and thank you for providing such a detailed post on the solution. I relayed this internally so hopefully we can figure out what the best path forward is.

2 Likes