stripe / stripe-react-native

React Native library for Stripe.
https://stripe.dev/stripe-react-native
MIT License
1.28k stars 263 forks source link

Unable to build an ios expo dev client with Expo SDK 50 and @stripe/stripe-react-native 0.35.1 #1621

Closed hbel closed 8 months ago

hbel commented 8 months ago

I am currently trying to use @stripe/stripe-react-native in an Expo app based on Expo SDK 50. Unfortunately, all my attempts to create a dev client for ios with this configuration failed so far (on android, everything seems to be in order).

These are my current dependencies:

"dependencies": {
    "@expo/vector-icons": "^14.0.0",
    "@react-native-community/slider": "4.4.2",
    "@react-navigation/native": "^6.1.15",
    "@tanstack/react-query": "^5.25.0",
    "axios": "^1.6.7",
    "expo": "^50.0.11",
    "expo-dev-client": "~3.3.9",
    "expo-font": "~11.10.3",
    "expo-linking": "~6.2.2",
    "expo-router": "^3.4.8",
    "expo-splash-screen": "^0.26.4",
    "expo-status-bar": "~1.11.1",
    "expo-system-ui": "~2.9.3",
    "expo-web-browser": "~12.8.2",
    "rambda": "^9.1.0",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-native": "0.73.4",
    "react-native-safe-area-context": "4.8.2",
    "react-native-screens": "~3.29.0",
    "react-native-track-player": "^4.0.1",
    "react-native-web": "~0.19.6",
    "zod": "^3.22.4",
    "zustand": "^4.5.2",
    "@stripe/stripe-react-native": "~0.35.1"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@types/react": "~18.2.45",
    "jest": "^29.2.1",
    "jest-expo": "~50.0.3",
    "react-test-renderer": "18.2.0",
    "typescript": "^5.4.2"
  },

and this is my plugin configuration from app.json:

"plugins": [
            "expo-router",
            [
                "@stripe/stripe-react-native",
                {
                    "merchantIdentifier": [],
                    "enableGooglePay": false
                }
            ]
        ],

When running a build, pod install fails because of a non-existent dependency:

[INSTALL_PODS] [!] CocoaPods could not find compatible versions for pod "StripePayments":
[INSTALL_PODS]   In Podfile:
[INSTALL_PODS]     stripe-react-native (from `../node_modules/@stripe/stripe-react-native`) was resolved to 0.35.1, which depends on
[INSTALL_PODS]       StripePayments (~> 23.18.0)
charliecruzan-stripe commented 8 months ago

That is the correct pod version we rely on for 0.35.1: https://github.com/stripe/stripe-react-native/blob/v0.35.1/stripe-react-native.podspec#L5

So I'm not sure why you'd get this error. I'm not sure where the dev client pulls in native dependencies but it could be an issue there? If you tried other versions of Stripe before that one, maybe your podfile.lock or Pods folder need to be cleared

hbel commented 8 months ago

Okay, thank you so much. It seems like this a local problem. Building on another machine works without problems. Sorry for the hassle and thanks for the advice, I should have tried that first.