android - 字段 'Signature' 的值不正确 : value is 662655099 but 67324752 expected

标签 android firebase android-studio firebase-realtime-database android-gradle-plugin

我一直在使用 Firebase 数据库。代码对于 Firebase 身份验证工作正常,但在添加 Firebase 数据库时显示此错误消息。

“签名”字段的值不正确:值为 662655099,但应为 67324752。

gradle脚本如下:

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


android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.sudhanshujaisani.mywhatsapp"
        minSdkVersion 21
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner             
"android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 
'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    implementation 'com.android.support:support-v4:27.1.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso- 
core:3.0.2'
    implementation 'com.android.support:design:27.1.1'
    implementation 'de.hdodenhof:circleimageview:3.0.0'
    implementation 'com.google.firebase:firebase-auth:16.0.1'
    implementation 'com.google.firebase:firebase-database:16.0.1'


}

提前致谢。

最佳答案

我真的不知道是什么导致了这个错误,但我也遇到过这个错误,并且我发现(经过一些研究)这是 Instant Run 的问题。它与 firebase 没有任何关系,但我认为它与 Gradle 和导入包有关。

无论如何,我认为禁用 Instant Run 是一种简单的解决方法,而且它奏效了! :)

在 Android Studio 中:

  1. 文件 -> 设置(或按 Ctrl+Alt+S)。
  2. 构建、执行、部署 -> 即时运行(在左侧面板上)。
  3. 取消选中第一个复选框“启用即时运行以在部署时热交换代码/资源更改(默认启用)”。

如果您确实需要 Instant Run,此变通办法将无济于事。我仍在努力寻找实际的解决方案。

关于android - 字段 'Signature' 的值不正确 : value is 662655099 but 67324752 expected,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54381596/

相关文章:

java - 如何旋转SeekBar上的TextView?

android - 我如何进行文本查询并在 Android 中获取位置?

android - 如何在后端而不是 App Engine 数据存储中创建与 Google Cloud SQL 连接的 Android 应用程序?

android - Phonegap 应用程序中的垂直间隙

java - 从 Android Studio 中的 fragment 中单击 recyclerview 中的cardview

firebase - Firebase 中的无崩溃用户指标

android - 如何在通知 FCM Android 上添加按钮

javascript - Ionic - AlertController 实例抛出未定义的错误

android - 在我的三星 Galaxy S10+ 上通过 IntelliJ/Android SDK 调试 Android 应用程序结果为 "Error while Installing APKs"

android - 错误:无法在[row,col]:[28,9]处解析XML ParseError消息:预期的开始或结束标记受影响的模块:app