无法解决:com.google.firebase:firebase-core:16.0.5

时间:2018-10-27 13:53:24

标签: android android-studio

我尝试了在互联网上找到的所有解决方案,但仍然收到以下错误:

Failed to resolve: com.google.firebase:firebase-core:16.0.5

可能是什么原因?我已经检查了所有实施列表是否完整以及正确的版本。我也检查了类路径和其他所有内容。但是什么都行不通!

build.grande(模块)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.example.ves.gennaio3"
        minSdkVersion 15
        targetSdkVersion 26
        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:26.1.0'
    implementation 'com.android.support:cardview-v7:26.1.0'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:support-v4:26.1.0'
    implementation 'com.android.support:recyclerview-v7:26.1.0'
    implementation 'com.google.firebase:firebase-auth:16.0.5'
    implementation 'com.google.firebase:firebase-core:16.0.5'
    implementation 'com.google.firebase:firebase-database:16.0.4'
    implementation 'com.google.firebase:firebase-ml-vision:18.0.1'
    implementation 'com.google.firebase:firebase-firestore:17.1.2'
    implementation 'com.github.satyan:sugar:1.5'
    implementation 'com.rmtheis:tess-two:6.0.0'
    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'
}

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

build.grandle(项目)

// 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.2.1'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:4.0.2'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

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

2 个答案:

答案 0 :(得分:5)

https://firebase.google.com/docs/android/setup起,看来16.0.4是最新版本

com.google.firebase:firebase-core:16.0.4

答案 1 :(得分:3)

@Johns解决方案不适用于我们,因为我们遇到了该版本的另一个已知问题(请参见https://developers.google.com/android/guides/releases

对我们有用的是使用firebase-core的别名:

POST <your_index_name>/_search { "query":{ "bool":{ "should":[ { "bool":{ "boost":100, "must":[ { "multi_match":{ "query":"....", "analyzer":"simple", "fuzziness":"AUTO", "use_dis_max":false, "fields":[ "name*" ] } }, { "type":{ "value":"C" } } ] } }, { "bool":{ "boost":5, "must":[ { "type":{ "value":"D" } }, { "multi_match":{ "query":"....", "analyzer":"simple", "fuzziness":0, "use_dis_max":false, "fields":[ "name*" ] } }, { "multi_match":{ "query":"....", "analyzer":"simple", "fuzziness":3, "fields":[ "name*" ] } } ] } } ] } } } 更改为

com.google.firebase:firebase-core:16.0.4