DEV Community

Sathya7032
Sathya7032

Posted on

Why Some Packages Like Google Sign-In or Razorpay Don’t Work in Expo — And How to Fix It

If you’re building an app with React Native using Expo, you may notice some packages — like Google Sign-In or Razorpay — don’t work in the default setup.

This is normal. Let’s see why and how to fix it.

1. Why They Don’t Work
Expo has two workflows:

1.Managed Workflow (default)

  • Easy to start.
  • No access to Android/iOS native code.
  • You can only use features Expo already supports.

2.Bare Workflow

  • You get full native code access.
  • You can install any React Native library.

Google Sign-In **and **Razorpay require changes to native files like Android Gradle and iOS plist — which the Managed Workflow hides from you.


*2. How to Make Them Work *
You have two main options.

Option 1: Use Expo EAS Build with Config Plugins
Step 1 — Install the package
Example: Google Sign-In

npm install @react-native-google-signin/google-signin
Enter fullscreen mode Exit fullscreen mode

Step 2 — Add its Config Plugin
If the library has a config plugin, add it to app.json or app.config.js:

{
  "expo": {
    "plugins": [
      "@react-native-google-signin/google-signin"
    ]
  }
}
Enter fullscreen mode Exit fullscreen mode

Step 3 — Prebuild (generate native code)

npx expo prebuild
Enter fullscreen mode Exit fullscreen mode

Step 4 — Build with EAS

npx eas build -p android   # for Android
npx eas build -p ios       # for iOS
Enter fullscreen mode Exit fullscreen mode

Option 2: Eject to Bare Workflow
Step 1 — Eject your Expo app

npx expo eject
This creates android/ and ios/ folders.

Step 2 — Install the package
Example: Razorpay

npm install react-native-razorpay
Enter fullscreen mode Exit fullscreen mode

Step 3 — Install iOS pods (if on Mac)

cd ios
pod install
cd ..
Enter fullscreen mode Exit fullscreen mode

Step 4 — Follow native setup instructions
Open:

  • android/ in Android Studio → add the Razorpay SDK settings in build.gradle.
  • ios/ in Xcode → configure plist or frameworks as per library docs.

Step 5 — Run the app

npx react-native run-android
npx react-native run-ios
Enter fullscreen mode Exit fullscreen mode

Top comments (0)