Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 版本冲突firebase库_Android_Firebase - Fatal编程技术网

Android 版本冲突firebase库

Android 版本冲突firebase库,android,firebase,Android,Firebase,我得到这个错误: 请通过更新的版本来修复版本冲突 谷歌服务插件(关于最新版本的信息 可在 ) 或者将com.google.android.gms的版本更新为16.0.1 我认为我得到的错误是由于实现了com.google.firebase:firebase messaging:17.1.0,因为如果我删除它,构建就成功了。但在尝试使用com.google.android.gms的16.0.1版进行消息传递时,我得到了以下信息: 无法解决错误 我认为该错误意味着com.google.firebas

我得到这个错误:

请通过更新的版本来修复版本冲突 谷歌服务插件(关于最新版本的信息 可在 ) 或者将com.google.android.gms的版本更新为16.0.1

我认为我得到的错误是由于实现了
com.google.firebase:firebase messaging:17.1.0
,因为如果我删除它,构建就成功了。但在尝试使用
com.google.android.gms
的16.0.1版进行消息传递时,我得到了以下信息:

无法解决错误

我认为该错误意味着
com.google.firebase:firebase消息:16.0.1
不可用。我的问题怎么解决

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'


android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "in.anamika.anamika"
        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.1'
    implementation 'com.googlecode.libphonenumber:libphonenumber:8.9.7'
    implementation 'com.google.firebase:firebase-auth:16.0.1'
    implementation 'com.google.firebase:firebase-database:16.0.1'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    testImplementation 'junit:junit:4.12'
    implementation 'com.android.support:design:27.1.1'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation('com.crashlytics.sdk.android:crashlytics:2.7.1@aar') {
        transitive = true
    }
    implementation 'com.google.firebase:firebase-messaging:17.1.0'
    implementation 'com.google.firebase:firebase-core:16.0.1'

}

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

您需要在node_模块中搜索其build.gradle的本机依赖项,并在此文件中查找以com.google.android.gms或com.google.firebase开头的依赖项。之后,您需要排除这些内部依赖项,并强制在任何地方使用相同的版本


希望这对您有所帮助。

在Android studio中有两个buld gradle文件

  • build.gradle(项目名称:ProjectName)
  • build.gradle(模块:应用程序)

  • 我也未能升级
    com.google.firebase:firebase消息:17.1.0
    ,然后我在build.gradle(项目名称)中编辑
    classpath'com.google.gms:google服务:3.0.1'
    classpath'com.google.gms:google服务:4.0.1',它工作正常。我终于可以升级到
    17.1.0

    试试
    implementation'com.google.firebase:firebase messaging:17.0.0
    在我的情况下,它很管用。您是否尝试过升级其他版本而不是降级?