gpt4 book ai didi

android - Android的Firebase:java.lang.NoClassDefFoundError:com.fasterxml.jackson.databind.ObjectMapper

转载 作者:行者123 更新时间:2023-12-03 16:48:40 26 4
gpt4 key购买 nike

我正在尝试使用Firebase数据库,但无法摆脱以下错误:

E/AndroidRuntime: FATAL EXCEPTION: main process:
com.example.useer.instantmessagingapp, PID: 21379
java.lang.NoClassDefFoundError:com.fasterxml.jackson.databind.ObjectMapper
at com.firebase.client.core.view.QueryParams.<clinit>(QueryParams.java:36)
at com.firebase.client.Firebase.<init>(Firebase.java:182)

这是gradle:
apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
defaultConfig {
applicationId "com.example.useer.instantmessagingapp"
minSdkVersion 17
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt')
'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile('com.firebase:firebase-client-android:2.3.1', {
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-bind'
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-annotations'
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-core'
})
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.google.firebase:firebase-database:9.6.1'
compile 'com.google.firebase:firebase-crash:9.6.1'
compile 'com.google.firebase:firebase-auth:9.6.1'
compile 'com.google.firebase:firebase-messaging:9.6.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

我在项目级别的gradle中添加了以下内容:
类路径'com.android.tools.build:gradle:2.2.3'
classpath'com.google.gms:google-services:3.0.0'

最佳答案

删除以下依赖项:

 compile('com.firebase:firebase-client-android:2.3.1', {
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-bind'
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-annotations'
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-core'
})

它是用于firebase.com的旧库,现已替换为:
compile "com.google.firebase:firebase-database:10.0.1"

关于android - Android的Firebase:java.lang.NoClassDefFoundError:com.fasterxml.jackson.databind.ObjectMapper,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41877920/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com