gpt4 book ai didi

android - 所有 gms/firebase 库必须使用完全相同的版本(混合版本会导致运行时崩溃)。找到版本 16.1.1 16.0.1 16.0.0 15.0.1

转载 作者:太空宇宙 更新时间:2023-11-03 12:44:23 25 4
gpt4 key购买 nike

尝试在我的项目中实现 Firebase 但 实现 'com.google.firebase:firebase-core:16.0.1' 这行带有下划线。请。

感谢 Mbuodile Obiosio,但我不知道是否有效。

apply plugin: 'com.android.application'

android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.harun.basicmathquiz"
minSdkVersion 15
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(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:support-annotations:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'

}

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

// 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:3.1.2'
classpath 'com.google.gms:google-services:4.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
maven { url "https://maven.google.com" }
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

我的错误:所有 gms/firebase 库必须使用完全相同的版本规范(混合版本可能导致运行时崩溃)。找到版本 16.1.1、16.0.1、16.0.0、15.0.1。示例包括 com.google.firebase:firebase-analytics-impl:16.1.1 和 com.google.firebase:firebase-analytics:16.0.1

最佳答案

升级顶层gradle文件中的google-service插件,避免混版本错误:

classpath 'com.google.gms:google-services:4.0.1'

https://bintray.com/android/android-tools/com.google.gms.google-services/

关于android - 所有 gms/firebase 库必须使用完全相同的版本(混合版本会导致运行时崩溃)。找到版本 16.1.1 16.0.1 16.0.0 15.0.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51222855/

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