I have created a Firestore Project in Android Studio. In which I have Firebase Authorization implemented and that is working absolutely fine. I am able to push documents to Firestore Database.
But now, I am trying to add functionality using which I can store media/images to Firebase Storage but when I am adding this dependency to app's build.gradle file, I am getting this error:
Dependency added:
implementation 'com.google.firebase:firebase-storage:16.0.1'
This is the error that I am getting:
Could not find firebase-common.jar (com.google.firebase:firebase-common:16.0.0).
Searched in the following locations:https://jcenter.bintray.com/com/google/firebase/firebase-common/16.0.0/firebase-common-16.0.0.jar
FYI, In my project I already have this kind of configuration:
classpath 'com.android.tools.build:gradle:3.1.3'
And
apply plugin: 'com.google.gms.google-services'
I can not find what is going wrong when I just add firebase-storage dependency to my Android project.
Here is my app level build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.firebase.example"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
}
dependencies {
implementation 'com.google.firebase:firebase-firestore:16.0.0'
implementation 'com.google.firebase:firebase-auth:15.1.0'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:23.2.1'
implementation 'com.android.support:design:23.2.1'
implementation 'com.android.support:recyclerview-v7:23.2.1'
}
apply plugin: 'com.google.gms.google-services'
Here is my module level build.gradle file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:4.0.1' // google-services plugin
classpath 'com.google.android.gms:play-services-base:15.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…