Android Question Problem with FirebaseAuth example

toby

Active Member
Licensed User
Happy New Year!

I followed the instructions precisely to the best of my knowledge. However the following event was never raised:
B4X:
Sub Auth_SignedIn (User As FirebaseUser)
    Log("SignedIn: " & User.DisplayName)
    lblName.Text = "Hello: " & User.DisplayName
End Sub

Each time the Sign in with Google button was pressed, the following log entries would be added:
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
** Activity (main) Resume **

I got the same result with both b4a7.30 and 7.80. Test phone: Asus zenfone 2, android 5.0. Could someone tell me what went wrong, please?

The complete debug log:
Logger connected to: asus ASUS_Z00AD
--------- beginning of main
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
** Service (starter) Destroy **
Copying updated assets files (2)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
** Activity (main) Resume **
 
Last edited:

toby

Active Member
Licensed User
After unchecking the Filter checkbox (it's checked by default), there were much more log information as shown below. The original package name b4a.firebase was used during previous attempt, so I appended 2 to it to have a new package name.

Logger connected to: asus ASUS_Z00AD
--------- beginning of main
[14673] Initialize library(version: 5.0.7a_y.48167 RELEASE)... successfully.
com.google.firebase.iid.FirebaseInstanceId is not linked. Skipping initialization.
com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
com.google.android.gms.measurement.AppMeasurement is not linked. Skipping initialization.
FirebaseApp initialization successful
SetAppTypeFace- try to flip, app = b4a.firebase2
Typeface getFontPathFlipFont - systemFont = default#default
Local module descriptor class for com.google.firebase.auth not found.
SetAppTypeFace- try to flip, app = b4a.firebase2
Typeface getFontPathFlipFont - systemFont = default#default
Starting remote logger. Port: 17489
Local module descriptor class for com.google.firebase.auth not found.
Render dirty regions requested: true
Validating map...
Initialized EGL, version 1.4
Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
Enabling debug mode 0
After accept
*** Debugger waiting for connection (0) ***
*** Debugger waiting for connection (1) ***
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
SetAppTypeFace- try to flip, app = b4a.firebase2
Typeface getFontPathFlipFont - systemFont = default#default
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
SetAppTypeFace- try to flip, app = b4a.firebase2
Typeface getFontPathFlipFont - systemFont = default#default
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
** Activity (main) Resume **
 
Upvote 0

toby

Active Member
Licensed User
Erel,

Thank you very much for the speedy responses!:)

Below is the new log with your new firebaseAuth.jar file.

Logger connected to: asus ASUS_Z00AD
--------- beginning of main
[17799] Initialize library(version: 5.0.7a_y.48167 RELEASE)... successfully.
com.google.firebase.iid.FirebaseInstanceId is not linked. Skipping initialization.
com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
com.google.android.gms.measurement.AppMeasurement is not linked. Skipping initialization.
FirebaseApp initialization successful
SetAppTypeFace- try to flip, app = b4a.firebase2
Typeface getFontPathFlipFont - systemFont = default#default
Local module descriptor class for com.google.firebase.auth not found.
SetAppTypeFace- try to flip, app = b4a.firebase2
Typeface getFontPathFlipFont - systemFont = default#default
Local module descriptor class for com.google.firebase.auth not found.
Starting remote logger. Port: 17489
After accept
Render dirty regions requested: true
Validating map...
Initialized EGL, version 1.4
Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
Enabling debug mode 0
*** Debugger waiting for connection (0) ***
*** Debugger waiting for connection (1) ***
Copying updated assets files (2)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
FirebaseAuth initialized
onAuthStateChanged: com.google.android.gms.internal.lr@2275525a
** Activity (main) Resume **
SignInWithGoogle called
** Activity (main) Pause, UserClosed = false **
SetAppTypeFace- try to flip, app = b4a.firebase2
Typeface getFontPathFlipFont - systemFont = default#default
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
SignInWithGoogle.ResultArrived
ResultArrived Success
** Activity (main) Resume **
SignInWithGoogle called
** Activity (main) Pause, UserClosed = false **
SetAppTypeFace- try to flip, app = b4a.firebase2
Typeface getFontPathFlipFont - systemFont = default#default
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
SignInWithGoogle.ResultArrived
ResultArrived Success
** Activity (main) Resume **
-1 received
writer error
java.lang.InterruptedException
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:1991)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2025)
at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:373)
at anywheresoftware.b4a.remotelogger.Connector$Writer.run(Connector.java:160)
at java.lang.Thread.run(Thread.java:818)
** Activity (main) Pause, UserClosed = true **
** Service (starter) Destroy **
System.exit called, status: 0
VM exiting with result code 0, cleanup skipped.
[18892] Initialize library(version: 5.0.7a_y.48167 RELEASE)... successfully.
com.google.firebase.iid.FirebaseInstanceId is not linked. Skipping initialization.
com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
com.google.android.gms.measurement.AppMeasurement is not linked. Skipping initialization.
FirebaseApp initialization successful
SetAppTypeFace- try to flip, app = b4a.firebase2
Typeface getFontPathFlipFont - systemFont = default#default
Local module descriptor class for com.google.firebase.auth not found.
SetAppTypeFace- try to flip, app = b4a.firebase2
Typeface getFontPathFlipFont - systemFont = default#default
Local module descriptor class for com.google.firebase.auth not found.
Starting remote logger. Port: 17489
Render dirty regions requested: true
Validating map...
Initialized EGL, version 1.4
Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
Enabling debug mode 0
*** Debugger waiting for connection (0) ***
*** Debugger waiting for connection (1) ***
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
FirebaseAuth initialized
** Activity (main) Resume **
onAuthStateChanged: com.google.android.gms.internal.lr@1624d7b9
After accept
SignInWithGoogle called
** Activity (main) Pause, UserClosed = false **
SetAppTypeFace- try to flip, app = b4a.firebase2
Typeface getFontPathFlipFont - systemFont = default#default
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
SignInWithGoogle.ResultArrived
ResultArrived Success
** Activity (main) Resume **
SignInWithGoogle called
** Activity (main) Pause, UserClosed = false **
SetAppTypeFace- try to flip, app = b4a.firebase2
Typeface getFontPathFlipFont - systemFont = default#default
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
SignInWithGoogle.ResultArrived
ResultArrived Success
** Activity (main) Resume **
SignInWithGoogle called
** Activity (main) Pause, UserClosed = false **
SetAppTypeFace- try to flip, app = b4a.firebase2
Typeface getFontPathFlipFont - systemFont = default#default
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
SignInWithGoogle.ResultArrived
ResultArrived Success
** Activity (main) Resume **
 
Upvote 0

toby

Active Member
Licensed User
it also includes firebase console screenshot and latest unfiltered logs in logs.txt file.
 
Upvote 0

toby

Active Member
Licensed User
Below is the unfiltered log with the new firebaseAuth.jar:

Logger connected to: asus ASUS_Z00AD
--------- beginning of main
[11979] Initialize library(version: 5.0.7a_y.48167 RELEASE)... successfully.
com.google.firebase.iid.FirebaseInstanceId is not linked. Skipping initialization.
com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
com.google.android.gms.measurement.AppMeasurement is not linked. Skipping initialization.
FirebaseApp initialization successful
SetAppTypeFace- try to flip, app = b4a.firebase
Typeface getFontPathFlipFont - systemFont = default#default
Local module descriptor class for com.google.firebase.auth not found.
SetAppTypeFace- try to flip, app = b4a.firebase
Typeface getFontPathFlipFont - systemFont = default#default
Starting remote logger. Port: 19343
Local module descriptor class for com.google.firebase.auth not found.
Render dirty regions requested: true
Validating map...
Initialized EGL, version 1.4
Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
Enabling debug mode 0
*** Debugger waiting for connection (0) ***
After accept
*** Debugger waiting for connection (1) ***
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
FirebaseAuth initialized
** Activity (main) Resume **
onAuthStateChanged: com.google.android.gms.internal.lr@26a86bcf
SignInWithGoogle called
** Activity (main) Pause, UserClosed = false **
SetAppTypeFace- try to flip, app = b4a.firebase
Typeface getFontPathFlipFont - systemFont = default#default
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
SignInWithGoogle.ResultArrived
ResultArrived Error: null
** Activity (main) Resume **
-1 received
writer error
java.lang.InterruptedException
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:1991)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2025)
at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:373)
at anywheresoftware.b4a.remotelogger.Connector$Writer.run(Connector.java:160)
at java.lang.Thread.run(Thread.java:818)
** Activity (main) Pause, UserClosed = true **
** Service (starter) Destroy **
System.exit called, status: 0
VM exiting with result code 0, cleanup skipped.
[12223] Initialize library(version: 5.0.7a_y.48167 RELEASE)... successfully.
com.google.firebase.iid.FirebaseInstanceId is not linked. Skipping initialization.
com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
com.google.android.gms.measurement.AppMeasurement is not linked. Skipping initialization.
FirebaseApp initialization successful
SetAppTypeFace- try to flip, app = b4a.firebase
Typeface getFontPathFlipFont - systemFont = default#default
Local module descriptor class for com.google.firebase.auth not found.
SetAppTypeFace- try to flip, app = b4a.firebase
Typeface getFontPathFlipFont - systemFont = default#default
Starting remote logger. Port: 19343
Local module descriptor class for com.google.firebase.auth not found.
Render dirty regions requested: true
Validating map...
Initialized EGL, version 1.4
Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
Enabling debug mode 0
*** Debugger waiting for connection (0) ***
After accept
*** Debugger waiting for connection (1) ***
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
FirebaseAuth initialized
** Activity (main) Resume **
onAuthStateChanged: com.google.android.gms.internal.lr@37a9295c
SignInWithGoogle called
** Activity (main) Pause, UserClosed = false **
SetAppTypeFace- try to flip, app = b4a.firebase
Typeface getFontPathFlipFont - systemFont = default#default
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
SignInWithGoogle.ResultArrived
ResultArrived Error: null
** Activity (main) Resume **
SignInWithGoogle called
** Activity (main) Pause, UserClosed = false **
SetAppTypeFace- try to flip, app = b4a.firebase
Typeface getFontPathFlipFont - systemFont = default#default
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
SignInWithGoogle.ResultArrived
ResultArrived Error: null
** Activity (main) Resume **
Notifying id token listeners about a sign-out event.
Notifying auth state listeners about a sign-out event.
Notifying auth state listeners.
Notified 0 auth state listeners.
onAuthStateChanged: com.google.android.gms.internal.lr@37a9295c
SignInWithGoogle called
** Activity (main) Pause, UserClosed = false **
SetAppTypeFace- try to flip, app = b4a.firebase
Typeface getFontPathFlipFont - systemFont = default#default
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
SignInWithGoogle.ResultArrived
ResultArrived Error: null
** Activity (main) Resume **
SignInWithGoogle called
** Activity (main) Pause, UserClosed = false **
SetAppTypeFace- try to flip, app = b4a.firebase
Typeface getFontPathFlipFont - systemFont = default#default
 
Upvote 0

toby

Active Member
Licensed User
Sometimes it returned Success, still SignedIn event wasn't raised.

I used a few Google accounts during tests, and I didn't notice any difference.
 
Upvote 0

toby

Active Member
Licensed User
It finally works after following your advice! Thank you very much, Erel, for your time.

To save time for those who run into similar situations, I list what I did below:
At b4a
1. Renamed the package name
2. Generated the private sign key
At firebase console
3. Selected a different project (I didn't create a new firebase project because I have another existing one)
4.Selected Authentication, selected sign in methods and selected google and saved the change.
5. Added a new app and downloaded the new Google-servivces.json file to the b4a project folder.
Back to b4a
6. Cleaned the project and ran the app.
 
Upvote 0
Top