2017-08-10 85 views
1

我尝试安装FirebaseUI,现在我有这个错误的gradle。我尝试安装gradle在build.gradle文件中告诉我的库,但Android Studio给我这个错误,它不让我按“安装库和同步项目”。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:[email protected]') { 
     transitive = true; 
    } 
    compile('com.mikepenz:materialdrawer:[email protected]') { 
     transitive = true 
    } 
    dependencies { 
     compile 'com.getbase:floatingactionbutton:1.10.1' 
    } 
    //Lollipin 
    compile('com.github.orangegangsters:lollipin:[email protected]') { 
     transitive = true 
    } 
    compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
     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:[email protected]' 
    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 
} 

请帮助我的人!

+0

您可以发布您的项目级的build.gradle? –

+0

是的!我刚添加它! – Gonzalo4488

+0

检查interenet连接 – Anil

回答

0

最近,谷歌开始通过行家回购分发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 
} 
0

朋友的 “安装库和同步工程” 最的解决方案是围棋到文件>无效缓存/重新启动,您将看到一个窗口,要求确认restart.Be知道当地的历史将被清除。 如果没有检查你安装的库版本并改变你的版本。

0

这里你所依赖的不是用你的编译工具匹配,所以你需要给的依赖,按您的构建工具版本供您需要删除所有依赖或从项目结构或其他变化版本名称添加为每个内部版本类似的决议以下,

像我已经安装生成工具25.0.1和我给依赖像compile 'com.android.support:recyclerview-v7:25.0.2'所以我需要改变像compile 'com.android.support:recyclerview-v7:25.0.1'所以它会工作。

+0

好吧,我使用buildToolsVersion“25.0.3”和FirebaseUI说,我需要使用“com.android.support:customtabs:25.4.0”但如果我想我的buildToolsVersion更改为25.4。 0 Android Studio告诉我该版本不存在。也许我需要使用和旧版本的FirebaseUI? – Gonzalo4488

+0

如果你更新你的构建工具版本,那就很好。如果从工作室无法做到,那么在设置最新的依赖关系后,您可以使用SDK管理器进行更新。 –

+0

我修好了!事实证明,我只是需要更新我的gradle到持续版本! – Gonzalo4488

相关问题