Java Question Get Firebase Firestore working in B4A

DonManfred

Expert
Licensed User
Longtime User
Hello,

i´m able to compile and run the Demo project from Firebase Introducing the new Firestore.
The App called Fireeats i can compile and run from Android Studio.

Based on the Compiled project sources/output i was able to find the right jar files to import in Eclipse to be able to write the wrapper...

B4X:
dependencies {
    // Firestore
    compile "com.google.firebase:firebase-firestore:11.4.2"

    // Other Firebase/Play services deps
    compile "com.google.firebase:firebase-auth:11.4.2"
    compile "com.google.android.gms:play-services-auth:11.4.2"

    // FirebaseUI (for authentication)
    compile 'com.firebaseui:firebase-ui-auth:2.3.0'

Android Studio is able to get these dependencies.

Am i able to get this working with B4A too somehow?

Can i simply add the these jars (AAR) in the dependson and/or use #additionaljar directive to add them in the b4a project.

Will the #additionaljar references jars be used instead of the versions in the active maven repos?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Am i able to get this working with B4A too somehow?
B4A only looks in the local repositories. If the AARs are not there then it will not work.

Can i simply add the these jars (AAR) in the dependson and/or use #additionaljar directive to add them in the b4a project.
Yes. You can always add them manually. Just copy them to the additional libs folder.
 

DonManfred

Expert
Licensed User
Longtime User
B4A only looks in the local repositories. If the AARs are not there then it will not work.
The files are not there because of they are beta and not inside the Maven repos downloaded by the SDK
I expect them to appear after Beta.
So my thoughts was right.
Yes. You can always add them manually. Just copy them to the additional libs folder.
That´s what i did. But i get a Problem getting the Firestore-instance. (Unknown source).


Can i get the FirebaseApp from the B4A Library Firebaseauth (the Original (yours)) and give it to the wrapper to be able to use a FirebaseApp inside the getInstance method?

Looks like the firebaseInitProvider does not return a valid FirebaseApp-Instance or so.

For now i am not using any Parameter
B4X:
ba.Log("FirebaseFirestore.getInstance();");
        mFirestore = FirebaseFirestore.getInstance();
        ba.Log("after FirebaseFirestore.getInstance();");
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
com.google.android.gms.common.internal.zzbp is not available in FirebaseAuth dependencies. I don't see how FirebaseAuth will help here.

FirebaseAuth dependencies can be added with:
B4X:
@DependsOn(values={"com.google.firebase:firebase-auth", "com.google.android.gms:play-services-auth"})

Search the Android Studio project files for zzbp class. It should be there somewhere.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…