【发布时间】:2018-05-14 18:16:25
【问题描述】:
因此,我查看了一堆有解决方案但没有任何工作的文章。将 Firebase 消息传递和 Firestore 库与 Google Pay 服务位置和地图一起使用时出现错误。每当我构建项目时,都会返回以下错误:
没有虚方法zzbqp()Ljava/lang/String;在班上 Lcom/google/firebase/FirebaseApp;或其超类(声明 'com.google.firebase.FirebaseApp' 出现在 /data/app/skutl.me.client-P4tdXC_WHOrJdSuzHJKp9Q==/base.apk)
以下是我的 gradle 配置文件:
顶级项目文件
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:3.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
} }
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com" // Google's Maven repository
}
google()
} }
task clean(type: Delete) {
delete rootProject.buildDir }
应用构建文件
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "skutl.me.client"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
google()
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://maven.google.com" }
}
dependencies {
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.firebaseui:firebase-ui-auth:3.1.3'
implementation 'com.google.firebase:firebase-messaging:15.0.2'
implementation 'com.google.firebase:firebase-firestore:16.0.0'
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.android.support:design:27.0.2'
implementation 'com.android.support:support-compat:27.0.2'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.android.support:multidex:1.0.1'
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
testImplementation 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
我尝试让它们都处于同一级别,但没有一个库具有相同的 v15 或 v16 版本。对这些错误有何见解?
【问题讨论】:
-
implementation 'com.google.firebase:firebase-core:15.0.2'在哪里 -
谢谢鲍勃和詹姆斯! Levi 所说的解决了这些问题。