TheQ
TheQ

Reputation: 2009

How to fix Firebase storage error?

so I am trying to use the Firebase storage, and when I copied and pasted these lines of code in dependencies:

compile 'com.google.firebase:firebase-storage:9.2.0'
compile 'com.google.firebase:firebase-auth:9.2.0'

I get a build error that states:

Error:(33, 13) Failed to resolve: com.google.firebase:firebase-storage:9.2.0 Show in File
Show in Project Structure dialog

AND

Error:Failed to resolve: com.google.firebase:firebase-core:9.2.0 Open File
Show in Project Structure dialog

and

Error:(34, 13) Failed to resolve: com.google.firebase:firebase-auth:9.2.0 Show in File
Show in Project Structure dialog

Here is what my dependencies look like.

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:24.0.0-beta1'
    compile 'com.android.support:design:24.0.0-beta1'
    compile 'com.firebase:firebase-client-android:2.3.1'
    compile 'com.firebaseui:firebase-ui:0.3.1'
    compile 'com.google.firebase:firebase-storage:9.2.0'
    compile 'com.google.firebase:firebase-auth:9.2.0'
}
apply plugin: 'com.google.gms.google-services'

Also, what is the difference between Firebase database and firebase storage? when would you use one over the other, dont they both store information for you?

Upvotes: 0

Views: 5764

Answers (1)

Mike McDonald
Mike McDonald

Reputation: 15953

Have you followed our getting started instructions? It's possible that you're missing the plugin that helps resolve these deps.

You're also going to want to remove the lines:

compile 'com.firebase:firebase-client-android:2.3.1'
compile 'com.firebaseui:firebase-ui:0.3.1'

and replace them with the upgraded versions:

compile 'com.google.firebase:firebase-database:9.2.0'
compile 'com.firebaseui:firebase-ui:0.4.2'

As for the difference between Firebase Database and Firebase Storage, the Firebase documentation says this:

  • The Firebase Realtime Database stores JSON application data, like game state or chat messages, and synchronizes changes instantly across all connected devices.

  • Firebase Remote Config stores developer-specified key-value pairs to change the behavior and appearance of your app without requiring users to download an update.

  • Firebase Hosting hosts the HTML, CSS, and JavaScript for your website as well as other developer-provided assets like graphics, fonts, and icons.

  • Firebase Storage stores files such as images, videos, and audio as well as other user-generated content.

Upvotes: 1

Related Questions