【问题标题】:Trying to add facebook authentication via firebase but my build.gradle app showing error尝试通过 firebase 添加 facebook 身份验证,但我的 build.gradle 应用显示错误
【发布时间】:2018-07-30 20:29:52
【问题描述】:

这是我的 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:runtime:1.0.3 打开文件
在项目结构对话框中显示

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

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

【问题讨论】:

  • 能否请您发布错误?
  • 编辑了问题并添加了错误请查看我的问题

标签: android facebook firebase


【解决方案1】:

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

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

或者像下面这样

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

【讨论】:

    猜你喜欢
    • 2017-01-25
    • 1970-01-01
    • 2019-05-30
    • 1970-01-01
    • 2019-12-17
    • 2021-05-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多