Android Studio更新后,Google和Firebase依赖项无法解析

时间:2017-08-25 04:49:32

标签: firebase gradle android-studio-2.3

我最近在Ubuntu 17.04上将Android工作室从2.1更新到2.3.3。另外,我必须将我的android.support依赖项从版本25.0.0更新到26.0.1,并将我的firebase依赖项从9.6.1更新到11.2.0。我已经尝试了SO上的一切无济于事,包括完全重新映像ubuntu。所有google / firebase依赖关系仍然无法解决所以它一定是我的错误。以下是我的gradle文件。

模块build.gradle

next_page = response.xpath('//span[@class="buttons"]//a[contains(., "next")]/@href').extract_first()

Project build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.1"

    defaultConfig {
        applicationId "me.myapp.app"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 10
        versionName "0.10.1"
    }
    buildTypes {
        release {
            shrinkResources true
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'),
  'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'

    compile 'com.android.support:appcompat-v7:26.0.1'
    compile 'com.android.support:support-v4:26.0.1'
    compile 'com.android.support:design:26.0.1'
    compile 'com.google.firebase:firebase-core:11.2.0'
    compile 'com.google.firebase:firebase-database:11.2.0'
    compile 'com.google.firebase:firebase-auth:11.2.0'
    compile 'com.google.firebase:firebase-crash:11.2.0'
    compile 'com.google.firebase:firebase-storage:11.2.0'
    compile 'com.google.firebase:firebase-messaging:11.2.0'
    compile 'com.facebook.android:facebook-android-sdk:[4,5)'
    compile 'com.github.amlcurran.showcaseview:library:5.4.3'
}




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

1 个答案:

答案 0 :(得分:2)

尝试添加

maven {
            url "https://maven.google.com"
        }

jcenter()之后

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