Android Question Firebase authentication problem

Stefano Di Chiano

Active Member
Licensed User
I was making an example app just to see if I could make the Firebase authentication work. I downloaded the example code from somewhere here on the forum and then I followed the steps indicated here and here, but I get the following error message when trying to run the project: Maven artifact not found: com.google.firebase/firebase-installations.
I even downloaded all the reccomended items from the SDK manger, so I must be either missing something or did something wrong from the tutorials I guess.
 

drgottjr

Expert
Licensed User
Longtime User
do you see this when you look at the sdk manager? if not, type "firebase-installations" in the little box and download.
 

Attachments

  • installed.png
    installed.png
    17.8 KB · Views: 122
Upvote 0

Stefano Di Chiano

Active Member
Licensed User
Thanks for the help, I didn't find them before but now I've installed them. I get another error though.
 

Attachments

  • errorefirebase.png
    errorefirebase.png
    29.9 KB · Views: 104
Upvote 0

Stefano Di Chiano

Active Member
Licensed User
Ok, here it is:
Logger connesso a: emulator-5554
--------- beginning of /dev/log/system
--------- beginning of /dev/log/main
Copying updated assets files (2)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 25 (Main)
java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process b4a.firebase.ex. Make sure to call FirebaseApp.initializeApp(Context) first.
at com.google.firebase.FirebaseApp.getInstance(com.google.firebase:firebase-common@@19.3.0:184)
at com.google.firebase.auth.FirebaseAuth.getInstance(com.google.firebase:firebase-auth@@19.3.0:1)
at anywheresoftware.b4a.objects.FirebaseAuthWrapper.Initialize(FirebaseAuthWrapper.java:54)
at b4a.firebase.ex.main._activity_create(main.java:387)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at b4a.firebase.ex.main.afterFirstLayout(main.java:104)
at b4a.firebase.ex.main.access$000(main.java:17)
at b4a.firebase.ex.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5021)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:827)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:643)
at dalvik.system.NativeStart.main(Native Method)
** Activity (main) Resume **
 
Upvote 0

Xicu

Active Member
Licensed User
Longtime User
This is the project by the way if needed.

do you see this when you look at the sdk manager? if not, type "firebase-installations" in the little box and download.
The @Stefano Di Chiano example works in my phone (I have dont install this last firebase components).
Please correct me if I'm wrong, but I think this latest update is causing problems. Read this thread. Try @Erel 's solution. It worked for me

 
Last edited:
Upvote 0

Stefano Di Chiano

Active Member
Licensed User
I still can't make it work. I tried both bluestacks and my phone but it crash either way.
I have a warning though that could help find what's wrong. It says: google-services.json not used.
I looked at the link @Xicu shared, but I couldn't find the "additional resources" Erel was talking about on that thread.
I may be wrong but since it runs on your phone I guess it is related to my B4A files, maybe between updates and downloads from the SDKmanager something went wrong.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
I have a warning though that could help find what's wrong. It says: google-services.json not used.
You need to place the file in your projectfolder. See firebase Integrationtutorial on how to get that file.

Edit to add:
It says: google-services.json not used.
Did you place the file in your files folder? Should not do that.
The file must be present in your project folder (folder where your b4a file is).
 
Upvote 0

Xicu

Active Member
Licensed User
Longtime User
I looked at the link @Xicu shared, but I couldn't find the "additional resources" Erel was talking about on that thread.
You will find the "addicional resources" at https://www.b4x.com/b4a.html
at point "2-Android SDK + Required Resources". There, you will find the link "Download the required resources." ?
Then like @Erel said, download the additional resources and copy extras\b4a_local and extras\b4a_remote from the additional resources to your SDK.
 
Upvote 0
Top