Android react本机google登录开发者错误代码10

Android react本机google登录开发者错误代码10,android,firebase,react-native,firebase-authentication,google-signin,Android,Firebase,React Native,Firebase Authentication,Google Signin,我正在尝试在我的项目中使用google登录firebase。我以前用过它,而且很成功,但这次我无法让它工作,我遵循了所有正确的步骤。使用react native 0.60 GitHub上的疑难解答建议将signingConfigs添加到build.gradle,但它已经在那里了。 SHA键是正确的,在另一个项目中使用了它,效果很好,唯一的区别是0.59 创建新的fire base项目 选择谷歌云平台(GCP)资源位置 设置支持电子邮件 启用谷歌认证 将Google Auth中的Web客户端ID

我正在尝试在我的项目中使用google登录firebase。我以前用过它,而且很成功,但这次我无法让它工作,我遵循了所有正确的步骤。使用react native 0.60

GitHub上的疑难解答建议将
signingConfigs
添加到build.gradle,但它已经在那里了。 SHA键是正确的,在另一个项目中使用了它,效果很好,唯一的区别是0.59


创建新的fire base项目
选择谷歌云平台(GCP)资源位置
设置支持电子邮件
启用谷歌认证
将Google Auth中的Web客户端ID添加到项目配置中
使用keytool-list-v-alias androiddebugkey-keystore%USERPROFILE%\.android\debug.keystore//生成的SHA密钥与其他项目使用的密钥相同
将google-services.json放置在app///内容中与页面和项目配置中的web客户端id匹配
为build.gradle添加了所有必需的代码
我在构建期间没有收到任何错误

//main build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 28
        supportLibVersion = "28.0.0"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:3.4.1")
        classpath 'com.google.gms:google-services:4.2.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }

        google()
        jcenter()
    }
}
//应用程序级build.gradle

...
def enableHermes = project.ext.react.get("enableHermes", false);

android {
    compileSdkVersion rootProject.ext.compileSdkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        applicationId "com.profitmaster"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 1
        versionName "1.0"
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
        }
    }
    signingConfigs {
        debug {
            storeFile file('debug.keystore')
            storePassword 'android'
            keyAlias 'androiddebugkey'
            keyPassword 'android'
        }
    }
    buildTypes {
        debug {
            signingConfig signingConfigs.debug
        }
        release {
            // Caution! In production, you need to generate your own keystore file.
            // see https://facebook.github.io/react-native/docs/signed-apk-android.
            signingConfig signingConfigs.debug
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }
    // applicationVariants are e.g. debug, release
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            // For each separate APK per architecture, set a unique version code as described here:
            // https://developer.android.com/studio/build/configure-apk-splits.html
            def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
            }

        }
    }

    packagingOptions {
        pickFirst '**/armeabi-v7a/libc++_shared.so'
        pickFirst '**/x86/libc++_shared.so'
        pickFirst '**/arm64-v8a/libc++_shared.so'
        pickFirst '**/x86_64/libc++_shared.so'
        pickFirst '**/x86/libjsc.so'
        pickFirst '**/armeabi-v7a/libjsc.so'
    }
}

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.facebook.react:react-native:+"  // From node_modules
    implementation 'com.google.firebase:firebase-core:17.0.0'

    if (enableHermes) {
      def hermesPath = "../../node_modules/hermesvm/android/";
      debugImplementation files(hermesPath + "hermes-debug.aar")
      releaseImplementation files(hermesPath + "hermes-release.aar")
    } else {
      implementation jscFlavor
    }
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
apply plugin: 'com.google.gms.google-services'
//应用程序启动

warn The following packages use deprecated "rnpm" config that will stop working from next release:
  - native-base: https://github.com/GeekyAnts/NativeBase#readme
  - react-native-google-signin: https://github.com/react-native-community/react-native-google-signin
Please notify their maintainers about it. You can find more details at https://github.com/react-native-community/cli/blob/master/docs/configuration.md#migration-guide.
info Starting JS server...
info Installing the app...

> Configure project :app
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

> Task :app:processDebugGoogleServices
Parsing json file: ...\projectPath\android\app\google-services.json

> Task :app:installDebug
11:46:22 V/ddms: execute: running am get-config
11:46:22 V/ddms: execute 'am get-config' on '192.168.240.103:5555' : EOF hit. Read: -1
11:46:22 V/ddms: execute: returning
Installing APK 'app-debug.apk' on 'Google Nexus 5 - 5.0' for app:debug
11:46:22 D/app-debug.apk: Uploading app-debug.apk onto device '192.168.240.103:5555'
11:46:22 D/Device: Uploading file onto device '192.168.240.103:5555'
11:46:22 D/ddms: Reading file permision of ...\projectPath\android\app\build\outputs\apk\debug\app-debug.apk as: rwx------
11:46:22 V/ddms: execute: running pm install -r -t "/data/local/tmp/app-debug.apk"
11:46:26 V/ddms: execute 'pm install -r -t "/data/local/tmp/app-debug.apk"' on '192.168.240.103:5555' : EOF hit. Read: -1
11:46:26 V/ddms: execute: returning
11:46:26 V/ddms: execute: running rm "/data/local/tmp/app-debug.apk"
11:46:26 V/ddms: execute 'rm "/data/local/tmp/app-debug.apk"' on '192.168.240.103:5555' : EOF hit. Read: -1
11:46:26 V/ddms: execute: returning
Installed on 1 device.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 13s
65 actionable tasks: 3 executed, 62 up-to-date
'adb' is not recognized as an internal or external command,
operable program or batch file.
info Connecting to the development server...
warn Failed to connect to development server using "adb reverse": spawnSync adb ENOENT
info Starting the app...

似乎与rn 0.60的大多数教程相反,SHA应该来自android/app文件夹


keytool-list-v-alias androiddebugkey-keystoreprojectname\android\app\debug.keystore

从2020年开始感谢您。拯救我的一天