java - Firebase 身份验证仅适用于调试版本
问题描述
我在 google play 上有一个应用程序:https: //play.google.com/store/apps/details?id=com.conta.ftof 我有一个大问题。我无法使用电话号码获得 Firebase 身份验证来处理签名版本。实际上,它仅适用于调试版本(在发布版本中,我插入数字并单击发送按钮,返回 toast:未知错误)...正是由于这个原因,我无法显示 logcats,只是因为仅在发布版本中出现错误...您能帮帮我吗?我给你留下代码:
注册活动的重要线路
@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);
}
**注册活动:** https://codeshare.io/5wBAzp
构建 Gradle:应用程序
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
}
errori nei logcat nel DEBUG
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
解决方案
推荐阅读
- json - 是否可以为一个 HTTP 请求发送多个 HTTP 响应?
- javascript - React useEffect:返回函数中的setState没有及时更新状态
- azure - Azure Web App ARR Affinity Token 场景
- php - Wordpress WooCommerce - 获取属性选项名称
- keyboard - 这是什么键盘布局?
- node.js - DiscordJS 音乐机器人连接,然后立即与语音频道断开连接
- html - 如何使视频的宽度为 100% 或高度为 100%
- swift - 覆盖扩展中的方法,Swift
- google-apps-script - 使用 Google Script 在 GDrive 中获取 XLSX 文件的 URL
- javascript - 反应菜单输入:选中