我一直在使用 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 中:
- 文件 -> 设置(或按 Ctrl+Alt+S)。
- 构建、执行、部署 -> 即时运行(在左侧面板上)。
- 取消选中第一个复选框“启用即时运行以在部署时热交换代码/资源更改(默认启用)”。
如果您确实需要 Instant Run,此变通办法将无济于事。我仍在努力寻找实际的解决方案。
关于android - 字段 'Signature' 的值不正确 : value is 662655099 but 67324752 expected,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54381596/