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

Flutter集成Firebase手机号验证遇授权错误,提示play_integrity_token无效

Firebase手机号验证报错[auth/app-not-authorized]排查方案

错误信息

Error sending OTP: [Error: [auth/app-not-authorized] This app is not authorized to use Firebase Authentication. Please verify that the correct package name, SHA-1, and SHA-256 are configured in the Firebase Console. [ Invalid app info in play_integrity_token ]]

排查步骤

  • 核对核心配置一致性

    • 确认Firebase控制台应用的包名与Android项目AndroidManifest.xml中的package字段完全匹配(大小写、特殊字符无差异)
    • 重新生成SHA指纹:执行keytool -list -v -keystore <你的密钥库路径>命令,确保Firebase应用设置中已添加对应环境(debug/release)的SHA-1和SHA-256指纹,无遗漏或错误
    • 检查Play Integrity关联:确认Firebase已启用Play Integrity,且关联的Google Play账号与应用发布账号一致,Play Console中的签名指纹与Firebase配置匹配
  • 本地项目清理重建

    • 执行flutter clean清除旧构建缓存
    • 从Firebase控制台重新下载最新的google-services.json,替换android/app目录下的旧文件
    • 执行flutter build apk(Android)或flutter build ios(iOS)完成完整构建
  • 验证Authentication模块设置

    • 进入Firebase控制台的Authentication模块,确认手机号验证方法已启用
    • 检查验证规则、模板配置无异常限制

内容的提问来源于stack exchange,提问作者Ibrahim Omar

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.28 10:29:58