Firebase dependency isnt showing up?

Viewed 151

So I've tried adding Firebase dependency to my gradle project. But it doesn't seem to be working. It adds fine, there's no errors or anything and I can see the firebase jar in my Referenced Libraries. But whenever I try to import anything from it like import google.com.firebase, it doesn't show up. What am I doing wrong? These are the only imports I'm seeing.

enter image description here

This is my repositories thing in build.gradle

repositories {
    mavenCentral()
    google()
    jcenter()
}

This is my dependencies thing

dependencies {
    compile 'com.google.firebase:firebase-database:19.3.1'
}

So basically, the dependency adds correctly I think, it does show up on the Referenced libraries on my IDE but I don't know why I cannot access it?

enter image description here

Btw I'm not making an Android app, it's a mod for minecraft that uses forge gradle.

Also this is my gradle version: https://services.gradle.org/distributions/gradle-4.1-all.zip

1 Answers

It was because i used an dependency meant for android developers with the aar extensions so instead of using

compile 'com.google.firebase:firebase-database:19.3.1'

In dependencies in build.gradle using this which is meant for the java thing works now.

compile 'com.google.firebase:firebase-admin:6.16.0'
Related