Flutter Firebase Phone Auth .apk 缺少有效的应用程序标识符,SafetyNet 和 reCAPTCHA 检查都不会成功

问题描述 投票:0回答:0

目前正在使用 Firebase Phone Number Auth,在 pc 的调试模式下运行良好,包括 iPhone 和 android 模拟器。

当我“

flutter build apk
”并将其放入我的智能手机时,应用程序会提示 “缺少有效的应用标识符,

enter image description here

我做了什么:

  1. 我在 firebase 项目设置中插入了 SHA-1 SHA-256

  2. SHA 均来自 android studio“

    Gradle signingReport
    ”命令

  3. 我注意到android studio生成的所有SHA都是相同的,包括“

    debug
    ”,“
    release
    ”等

  4. 我启用了谷歌云控制台的

    Google Play Integrity API
    ,但没有包含任何参数或凭据,因为只是启用,没有做任何配置。

  5. 我已经确保 flutter 应用程序有最新的

    google-service.json

  6. 在 build.gradle 下,我有以下内容:

    implementation 'com.google.android.gms:play-services-base:6.5.87'

    implementation 'com.google.android.play:integrity:1.1.0'

    implementation 'com.google.firebase:firebase-analytics'

    implementation platform('com.google.firebase:firebase-bom:31.1.1')

    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

    implementation 'com.google.firebase:firebase-appcheck-safetynet:16.0.0-beta05'

    implementation 'com.google.android.gms:play-services-safetynet:18.0.1'

    implementation 'com.google.firebase:firebase-auth'

    implementation 'androidx.browser:browser:1.3.0'

  7. flutter build apk
    命令,所有版本都遇到同样的错误。

我已经在网上浏览了所有可能的解决方案,但仍然没有用。

如何让Phone Auth重新生效?

flutter firebase recaptcha safetynet
© www.soinside.com 2019 - 2024. All rights reserved.