0

我想使用此link.与Firebase实时数据库一起使用。第6步之后,它给无法解决:com.google.firebase:firebase-core:9.6.1

无法解析

错误。

的build.gradle应用模块:

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "24.0.0" 

    defaultConfig { 
     applicationId "gc.imageuploader" 
     minSdkVersion 14 
     targetSdkVersion 23 
     versionCode 1 
     versionName "1.0" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:23.4.0' 
    compile 'com.google.firebase:firebase-database:9.6.1' 
} 
apply plugin: 'com.google.gms.google-services' 

的build.gradle项目模块:

// 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.1.2' 
     classpath 'com.google.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 
} 

所以,我怎么能解决这个问题?我该怎么办?你对这个问题有什么看法?

+0

确保您在Android SDK管理器中拥有最新的Google Repository –

+0

如何操作?我是新手。 –

+1

检查如何从接受的答案更新Google Play服务和Google Respository http://stackoverflow.com/questions/37310188/failed-to-resolve-com-google-firebasefirebase-core9-0-0?rq=1 –

回答

1

请确保您有最新版本的“谷歌Play服务”,而使用火力地堡安装“谷歌库”

请按照下列步骤操作:

  1. 打开Android工作室
  2. 转到菜单栏>工具>安卓> SDK管理器
  3. 点击选项卡> SDK工具
  4. 检查并安装“ Google Play服务''Google知识库'
  5. 单击应用并等待下载

最后,同步构建再次你的项目。