![](/img/trans.png)
[英]Failed to resolve: com.google.firebase:firebase-core:16.0.1
[英]“Failed to resolve: com.google.firebase:firebase-core:9.0.0”
我想在我的Android應用程序中使用fire base來進行身份驗證
我將它添加到我的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 }
將此應用添加到我的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'
但是出現了這個錯誤
這個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); } }
將此行com.google.firebase:firebase-auth:9.6.1'
到您的build.gradle依賴項,例如: https ://firebase.google.com/docs/android/setup,而不是核心使用auth。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.