无法解析:com.google.firebase:firebase-core:9.0.0

4

我想在我的安卓应用程序中使用 Firebase 进行身份验证。

  1. I create the app then downloaded the JSON File and Paste it into app folder
  2. I added this to my build.gradle > Project

     // 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. add this apply to my build.gradle > app

    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'
    

    but this error appeared enter image description here

enter image description here

  1. this 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
“this error appear to me”不是一个非常明确的标题。将来您可能需要考虑使标题更具体以解决问题。 - ChiefTwoPencils
1个回答

0

错误:(25,13)无法解析:com.google.firebase:firebase-auth:9.6.1 <a href="openFile:C:/Users/mahmoud/AndroidStudioProjects/LoginWithFirebase/app/build.gradle">在文件中查看</a><br><a href="open.dependency.in.project.structure">在项目结构对话框中查看</a> - Mahmoud Belal
1
前往Android SDK管理器并安装最新版本的两个库:Google Play服务和Google存储库。如果无法使用,请尝试使用firebase-auth:9.6.0而不是9.6.1。 - T.S

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接