2017-04-13 102 views
0

我需要進口火力的UI我的應用程序,但我收到的時候我同步gradle這個錯誤嘗試導入火力的UI

Error:Could not find com.google.services.gms:google-services:3.0.0. 
Searched in the following locations: 
    file:/D:/NewAndroid/androidStudios/mew/gradle/m2repository/com/google/services/gms/google-services/3.0.0/google-services-3.0.0.pom 
    file:/D:/NewAndroid/androidStudios/mew/gradle/m2repository/com/google/services/gms/google-services/3.0.0/google-services-3.0.0.jar 
    https://jcenter.bintray.com/com/google/services/gms/google-services/3.0.0/google-services-3.0.0.pom 
    https://jcenter.bintray.com/com/google/services/gms/google-services/3.0.0/google-services-3.0.0.jar 
Required by: 
    project : 

我剛剛下載的Android工作室這個錯誤,所以一切是最新的和一切直到我嘗試導入firebase-ui。

的build.gradle(項目:ChatApp)

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

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.2.1' 
     classpath 'com.google.services.gms:google-services:3.0.0' 

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

allprojects { 
    repositories { 
     jcenter() 
    } 
} 

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

的build.gradle(模塊:APP)

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.2" 
    defaultConfig { 
     applicationId "com.example.emilythacker.chatapp" 
     minSdkVersion 15 
     targetSdkVersion 25 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 
    compile 'com.android.support:appcompat-v7:25.3.1' 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    testCompile 'junit:junit:4.12' 

    //Add library 
    compile 'com.android.support:design:25.3.1' 
    compile 'com.firebaseui:firebase-ui:1.2.0' 
} 

回答

1

在項目的build.gradle文件,這樣的:

classpath 'com.google.services.gms:google-services:3.0.0' 

應該是:

classpath 'com.google.gms:google-services:3.0.0' 

要解決Twitter的錯誤,更新項目的build.gradle:

allprojects { 
    repositories { 
     jcenter() 
     maven { url 'https://maven.fabric.io/public' } // <= ADD THIS 
    } 
} 

它是由Firebase Auth UI需要。

+0

哇感謝。該錯誤走開了,但現在它說錯誤:無法解析:com.twitter.sdk.android:twitter:2.3.0。你知道那是關於什麼嗎? –

+0

看到我更新的答案。 –

相關問題