2017-08-10 86 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

相關問題