You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

React Native Google Signin iOS真机运行报错求助

解决react-native-google-signin在iOS真机报错“No member named '__rip' in '__darwin_arm_thread_state64'”

我之前踩过这个坑,这是因为react-native-google-signin依赖的Google Sign-In SDK在ARM架构的iOS真机上存在兼容性问题,尤其是使用旧版本库的时候。下面是几个亲测有效的解决步骤:

  • 升级react-native-google-signin到最新稳定版
    旧版本的库往往没做好ARM64真机的适配,先把库更新到最新版:

    # npm用户
    npm install @react-native-google-signin/google-signin@latest
    # yarn用户
    yarn add @react-native-google-signin/google-signin@latest
    

    更新完成后,进入iOS目录重新安装依赖:

    cd ios && pod install --repo-update
    
  • 手动指定GoogleSignIn SDK版本
    如果升级库后问题依然存在,可以直接在Podfile里锁定最新的GoogleSignIn SDK版本,避免自动安装兼容性差的旧版本。在ios/Podfile中添加以下代码:

    pod 'GoogleSignIn', '~> 7.0.0' # 可替换为当前官方最新的稳定版本号
    

    然后再次执行pod install --repo-update。

  • 调整Xcode架构配置
    打开Xcode,选中你的项目,进入Build Settings:

    1. 找到Architectures,设置为Standard Architectures (ARM64, x86_64)
    2. 找到Excluded Architectures,针对真机配置(Debug/Release下的iOS),移除其中的arm64选项
    3. 确认Build Active Architecture Only在Debug模式下为YES,Release模式下为NO
  • 清理缓存并重新构建
    缓存问题也可能导致这类奇怪的报错,按顺序执行以下操作:

    # 清理React Native缓存
    npx react-native clean
    

    然后在Xcode中执行Product -> Clean Build Folder(快捷键Cmd+Shift+K),删除ios/Pods文件夹和Podfile.lock,重新执行pod install,最后重启Xcode和你的真机设备再重新编译。

  • 验证谷歌登录配置正确性
    确保你在Google Cloud Console中已经为iOS应用配置了正确的Bundle ID,并且下载的GoogleService-Info.plist文件是通过Xcode的Add Files to...功能添加到项目中的(不是直接复制到文件夹里),避免配置文件没有被正确识别。

内容的提问来源于stack exchange,提问作者Sunil M.

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 10:16:25