Android Studio不会让我“安装存储库和同步项目”

时间:2017-08-10 03:49:40

标签: java android android-studio gradle firebaseui

我尝试安装FirebaseUI,现在我遇到了这个gradle错误。我尝试在build.gradle文件中安装gradle告诉我的库,但是Android Studio给了我这个错误,它不允许我按“安装存储库和同步项目”。

Error given by gradle

这是我的build.gradle文件

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

repositories {
    maven { url 'https://maven.fabric.io/public' }
}

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.0"
    defaultConfig {
        applicationId "com.avantefg.avante"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    signingConfigs {
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
        }
    }
    productFlavors {
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile('com.digits.sdk.android:digits:2.0.2@aar') {
        transitive = true;
    }
    compile('com.mikepenz:materialdrawer:5.8.0@aar') {
        transitive = true
    }
    dependencies {
        compile 'com.getbase:floatingactionbutton:1.10.1'
    }
    //Lollipin
    compile('com.github.orangegangsters:lollipin:2.0.0@aar') {
        transitive = true
    }
    compile('com.crashlytics.sdk.android:crashlytics:2.6.7@aar') {
        transitive = true;
    }

    compile 'com.google.gms:google-services:3.1.0'
    compile 'com.wang.avi:library:2.1.3'
    compile 'jp.wasabeef:blurry:2.0.3'
    compile 'com.google.firebase:firebase-messaging:11.0.4'
    compile 'com.google.firebase:firebase-auth:11.0.4'
    compile 'com.firebaseui:firebase-ui-auth:2.2.0'
    compile 'io.github.yuweiguocn:SquareLoading:1.3.0'

    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support:support-v4:25.3.1'
    compile 'com.android.support:design:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
    compile 'com.android.support:customtabs:25.3.1'



    compile 'com.jakewharton:butterknife:8.4.0'
    compile 'com.cocosw:bottomsheet:1.+@aar'
    compile 'com.squareup.okhttp3:okhttp:3.4.2'
    compile 'com.github.barteksc:android-pdf-viewer:2.7.0-beta.1'
    compile 'com.android.volley:volley:1.0.0'
    testCompile 'junit:junit:4.12'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
}

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

这是项目build.grade文件

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
        maven { url 'https://maven.fabric.io/public' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath 'io.fabric.tools:gradle:1.+'
        classpath 'com.google.gms:google-services:3.1.0'



        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        maven{
            url "https://github.com/omadahealth/omada-nexus/raw/master/release"
        }
        jcenter()
    }
}

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

请有人帮助我!

3 个答案:

答案 0 :(得分:0)

最近,Google开始通过maven repo分发android支持库。

您可以尝试添加

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

在项目级别build.gradle

示例:

buildscript {
    ext.kotlin_version = '1.1.3-2'
    repositories {
        maven { url 'https://maven.google.com' }
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0-alpha9'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        maven { url 'https://maven.google.com' }
        jcenter()
        mavenCentral()
        maven { url 'http://devrepo.kakao.com:8088/nexus/content/groups/public/' 
}
    }
}

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

答案 1 :(得分:0)

“安装存储库和同步项目”的最佳解决方案是转到文件>无效缓存/重新启动,您将看到一个窗口,要求确认重新启动。请注意本地历史记录将是清除。 如果这不检查您安装的库版本并将其更改为您拥有的。

答案 2 :(得分:0)

此处您的依赖项与您的BuildTools不匹配,因此您需要根据您的构建工具版本为您需要删除所有依赖项或从Project结构中添加的解决方案提供依赖项,或者根据构建版本更改版本名称,如下所示,

就像我已经安装了构建工具25.0.1并且我给了compile 'com.android.support:recyclerview-v7:25.0.2'之类的依赖关系所以我需要像compile 'com.android.support:recyclerview-v7:25.0.1'那样改变所以它会起作用。

相关问题