2016-10-22 43 views
4

我想用火基地,在我的Android應用程序,以驗證「無法解析:com.google.firebase:火力核心:9.0.0」

  1. 我創建的應用程序,然後下載的JSON文件並將其粘貼到app文件夾
  2. 我將此添加到我的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.2.1' 
         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 
    } 
    
  3. 添加此應用到我的build.gradle>應用程序

    apply plugin: 'com.android.application' 
    android { 
        compileSdkVersion 24 
        buildToolsVersion "23.0.1" 
        defaultConfig { 
         applicationId "com.example.mahmoud.loginwithfirebase" 
         minSdkVersion 15 
         targetSdkVersion 24 
         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:24.2.1' 
        testCompile 'junit:junit:4.12' 
    } 
    apply plugin: 'com.google.gms.google-services' 
    

    但此錯誤出現enter image description here

enter image description here

  • 此MainActivity.java

    package com.example.mahmoud.loginwithfirebase; 
    
    import android.support.v7.app.AppCompatActivity; 
    import android.os.Bundle; 
    
        public class MainActivity extends AppCompatActivity { 
    
         @Override 
         protected void onCreate(Bundle savedInstanceState) { 
          super.onCreate(savedInstanceState); 
          setContentView(R.layout.activity_main); 
         } 
        } 
    
  • +1

    「這個錯誤在我看來」不是一個非常具體的標題。將來您可能會考慮讓您的標題更具體一些,以解決您的問題。 – ChiefTwoPencils

    回答

    0

    添加此行com.google.firebase:firebase-auth:9.6.1'到你的build.gradle依賴項裏ke這裏:https://firebase.google.com/docs/android/setup,而不是核心使用auth。

    +0

    我嘗試過,但所發生 –

    +0

    錯誤:(25,13)無法解析:com.google.firebase:火力-AUTH:9.6.1 Show in File
    Show in Project Structure dialog

    +1

    轉到Android SDK中經理並安裝最新版本的兩個圖書館:Google Play服務和Google存儲庫。如果它不起作用,請嘗試使用firebase-auth:9.6.0而不是9.6.1。 –

    相關問題