Firebase身份验证仅适用于调试版本

时间:2020-10-14 19:51:28

标签: java android firebase firebase-authentication

我在Google Play上有一个应用:https://play.google.com/store/apps/details?id=com.conta.ftof 我有一个大问题。我无法使用电话号码进行Firebase身份验证以在签名版本上使用。实际上,它仅适用于调试版本(在发行版本中,我插入数字并单击“发送”按钮时,将返回吐司:未知错误)...正是由于这个原因,我无法显示logcat,因为仅在发布版本中存在错误...您能帮我吗?我给你的代码:

重要的注册活动

@Override
            public void onVerificationFailed(FirebaseException e) {

                if (e instanceof FirebaseAuthInvalidCredentialsException) {
                    Toast.makeText(RegistrationActivity.this, "Numero inserito non valido...", Toast.LENGTH_SHORT).show();
                }
                else if (e instanceof FirebaseTooManyRequestsException) {
                    Toast.makeText(RegistrationActivity.this, "Troppe richieste per questo numero di telefono, riprova tra 24h", Toast.LENGTH_SHORT).show();
                }

                else if (e instanceof FirebaseNetworkException){
                    Toast.makeText(RegistrationActivity.this, "Errore di rete...", Toast.LENGTH_SHORT).show();
                }

                else {

                    Toast.makeText(RegistrationActivity.this, "Errore sconosciuto", Toast.LENGTH_SHORT).show();
                }

                Log.e(TAG,  "err : " + e);
                loadingBar.dismiss();


               // Toast.makeText(RegistrationActivity.this, "Numero inserito non valido...", Toast.LENGTH_SHORT).show();
                relativeLayout.setVisibility(View.VISIBLE);


                continueAndNextBtn.setText("Continue"); //Continue
                codeText.setVisibility(View.GONE);


            }

** RegistrationActivity:** https://codeshare.io/5wBAzp

Build Gradle:app

    apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.3"
    lintOptions {
        checkReleaseBuilds false
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    }

    defaultConfig {
        applicationId "com.conta.ftof"
        minSdkVersion 21
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

        }
    }
}

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.firebase:firebase-auth:19.3.1'
    implementation 'com.google.firebase:firebase-database:19.3.0'
    implementation 'com.google.firebase:firebase-core:17.4.3'
    implementation 'com.firebaseui:firebase-ui-database:3.2.2'
    implementation 'com.hbb20:ccp:2.1.9'
    implementation 'pub.devrel:easypermissions:0.4.0'
    implementation 'com.android.support:percent:29.0.0'
    implementation 'com.google.android.gms:play-services-ads:19.4.0'


    implementation 'com.google.firebase:firebase-storage:19.1.1'
    implementation 'com.google.android.material:material:1.1.0'
    implementation 'androidx.navigation:navigation-fragment:2.2.2'
    implementation 'androidx.navigation:navigation-ui:2.2.2'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
    implementation 'com.opentok.android:opentok-android-sdk:2.15.3'
    implementation 'pub.devrel:easypermissions:0.4.0'
    implementation 'com.squareup.picasso:picasso:2.71828'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation 'com.google.firebase:firebase-analytics:17.4.3'

}

构建Gradle

    // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.0.0"
        classpath 'com.google.gms:google-services:4.3.3'

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

allprojects {
    repositories {
        google()
        jcenter()

        maven { url 'https://maven.google.com'}
        maven { url 'https://tokbox.bintray.com/maven'}
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

错误日志调试

        2020-10-14 21:46:16.629 12564-12564/com.conta.ftof E/RegistrationActivity: err : com.google.firebase.FirebaseException: An internal error has occurred. [ Error code:39 ]
        
        2020-10-14 21:46:16.697 2026-4029/? E/Auth: [GoogleAccountDataServiceImpl] getToken() -> BAD_AUTHENTICATION. Account: <ELLIDED:718006122>, App: com.google.android.gms, Service: oauth2:https://www.googleapis.com/auth/emeraldsea.mobileapps.doritos.cookie
        rlv: Long live credential not available.
            at gbq.a(:com.google.android.gms@202614030@20.26.14 (100408-320008519):17)
            at gac.a(:com.google.android.gms@202614030@20.26.14 (100408-320008519):118)
            at cqx.a(:com.google.android.gms@202614030@20.26.14 (100408-320008519):235)
            at cqx.a(:com.google.android.gms@202614030@20.26.14 (100408-320008519):108)
            at cqx.a(:com.google.android.gms@202614030@20.26.14 (100408-320008519):240)
            at cox.onTransact(:com.google.android.gms@202614030@20.26.14 (100408-320008519):5)
            at android.os.Binder.transact(Binder.java:675)
            at csu.onTransact(:com.google.android.gms@202614030@20.26.14 (100408-320008519):2)
            at android.os.Binder.transact(Binder.java:675)
            at zyq.onTransact(:com.google.android.gms@202614030@20.26.14 (100408-320008519):17)
            at android.os.Binder.execTransact(Binder.java:739)
        
            2020-10-14 21:46:16.718 612-832/? E/BufferQueueProducer: [] mConsumerName == NULL!!!!!!
    2020-10-14 21:46:16.577 688-1286/? E/dubaid: [DubaiUtils.h] parseMessage# Failed to find second tag: uid=
    2020-10-14 21:46:16.577 688-1286/? E/dubaid: [SystemHandler.cpp] parsePartialWakelockAcquiredMessage# Failed to parse count: lock=220525660 tag=*gms_scheduler*:internal count=0
    2020-10-14 21:46:16.577 688-1286/? E/dubaid: [SystemHandler.cpp] onPartialWakelockAcquireMessage# Failed to parse message
    2020-10-14 21:46:16.580 2664-7832/? E/Volley: [420] BasicNetwork.performRequest: Unexpected response code 503 for https://www.googleapis.com/identitytoolkit/v3/relyingparty/sendVerificationCode?alt=proto&key=AIzaSyA3J5SF6W94IhtZ_dQ6UOVqUhIN133zrhU

2020-10-14 21:46:15.834 1272-3654/? E/WifiService: enforceCanAccessScanResults: hiding ssid and bssidLocation mode is disabled for the device

0 个答案:

没有答案