Expo Go Stripe:本机模块不能为空

Expo Go Stripe: Native module cannot be null

我相信 Expo-Go 现在可以支持 Stripe 支付(基于提供的更新文档 here。)

我正在使用 Expo SDK 版本 40。

我表演

"expo install @ stripe/stripe-react-native"

确保我得到正确的版本。

然后我尝试使用以下方法将 Stripe 导入到我的项目中:

import { StripeProvider } from '@stripe/stripe-react-native'

项目一刷新,应用程序就崩溃并抛出 ~25 errors/warnings,最常见的是“本机模块不能为空”错误

有没有其他人遇到过这个错误?

I am using Expo SDK Version 40.

我相信你必须使用像 41/42 这样的更高版本,所以我会尝试更新它。根据您分享的 link,例如您会注意到 https://docs.expo.dev/versions/v41.0.0/sdk/stripe/ exists but https://docs.expo.dev/versions/v40.0.0/sdk/stripe/ 不是。

https://github.com/stripe/stripe-react-native/issues/467#issuecomment-889217595

https://github.com/stripe/stripe-react-native/issues/256#issuecomment-846922117