尝试通过Firebase添加Facebook身份验证,但我的build.gradle应用显示错误

时间:2018-07-30 20:29:53

标签: android facebook firebase

这是我的build.gradle应用程序代码。我正在尝试使用Firebase应用程序添加Facebook身份验证,但是我的build.gradle应用程序显示错误 所以请帮助我摆脱这个错误。

            apply plugin: 'com.android.application'

 android {
compileSdkVersion 25
buildToolsVersion "27.0.3"
defaultConfig {
    applicationId "com.example.game.chatshat"
    minSdkVersion 16
    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'
    }
}
 }

     repositories {
maven {
         url 'https://dl.bintray.com/spark/maven'



}
   }

   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:design:25.3.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'de.hdodenhof:circleimageview:2.2.0'
compile 'com.theartofdev.edmodo:android-image-cropper:2.4.+'
compile 'com.google.firebase:firebase-storage:10.0.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.firebaseui:firebase-ui-database:1.1.1'
testCompile 'junit:junit:4.12'
compile 'id.zelory:compressor:2.1.0'
compile 'com.squareup.okhttp:okhttp:2.5.0'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:gridlayout-v7:25.3.1'
compile 'me.spark:submitbutton:1.0.1'
compile 'com.unstoppable:submitbutton:1.1.3'
compile 'com.facebook.android:facebook-login:[4,5)'
}
          apply plugin: 'com.google.gms.google-services'

bulid.gradle应用程序文件向我显示此错误

错误:无法解决:com.android.support:support-annotations:27.0.2                    安装存储库并同步项目
打开文件
在“项目结构”对话框中显示

错误:无法解决:com.android.support:customtabs:27.0.2 安装存储库并同步项目
打开文件
在“项目结构”对话框中显示

错误:无法解决:com.android.support:appcompat-v7:27.0.2 安装存储库并同步项目
打开文件
在“项目结构”对话框中显示

错误:无法解决:com.google.firebase:firebase-core:11.6.2 打开文件
在“项目结构”对话框中显示

错误:无法解决:com.android.support:support-v4:27.0.2 安装存储库并同步项目
打开文件
在“项目结构”对话框中显示

错误:无法解决:android.arch.lifecycle:运行时:1.0.3 打开文件
在“项目结构”对话框中显示

错误:无法解决:com.android.support:cardview-v7:27.0.2 安装存储库并同步项目
打开文件
在“项目结构”对话框中显示

错误:(38,13)无法解决:com.google.firebase:firebase-auth:11.6.2 在文件中显示
在项目结构对话框中显示

1 个答案:

答案 0 :(得分:0)

在您的root build.gradle文件中包括google(),如下所示

allprojects {
    repositories {
        google()
        jcenter()
    }
}

或如下所示

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