I'm implementing Facebook login via FirebaseAuth.
The main problem is that after I sign in (successfully) the app crash.
The secondary problem is that when I was using B4A Bridge the logs didn't show.
I tried with an emulator and I got the following error:
On line 41 of the starter service there is just: Log(User.Email).
I'm using B4A version 9.80.
If needed, this is my manifest:
The main problem is that after I sign in (successfully) the app crash.
The secondary problem is that when I was using B4A Bridge the logs didn't show.
I tried with an emulator and I got the following error:
Logger connesso a: emulator-5554
--------- beginning of /dev/log/system
--------- beginning of /dev/log/main
Copying updated assets files (1)
*** Service (starter) Create ***
** Service (starter) Start **
onAuthStateChanged: com.google.firebase.auth.internal.zzl@4e82a120
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Facebook - SignIn
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
Facebook - ResultArrived: Intent { (has extras) }
Facebook success: com.facebook.login.LoginResult@4e996dc0
signInWithCredential start
** Activity (main) Resume **
onAuthStateChanged: com.google.firebase.auth.internal.zzl@4e82a120
SignedIn: Stefano Di Chiano
AKXb0iY01ORBY88qFdYap3kvBlP2
Error occurred on line: 41 (Starter)
java.lang.NullPointerException
at anywheresoftware.b4a.BA.addLogPrefix(BA.java:587)
at anywheresoftware.b4a.keywords.Common.LogImpl(Common.java:191)
at b4a.logintest.starter._auth_signedin(starter.java:162)
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:348)
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 anywheresoftware.b4a.BA$2.run(BA.java:370)
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)
signInWithCredential complete: true
--------- beginning of /dev/log/system
--------- beginning of /dev/log/main
Copying updated assets files (1)
*** Service (starter) Create ***
** Service (starter) Start **
onAuthStateChanged: com.google.firebase.auth.internal.zzl@4e82a120
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Facebook - SignIn
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
Facebook - ResultArrived: Intent { (has extras) }
Facebook success: com.facebook.login.LoginResult@4e996dc0
signInWithCredential start
** Activity (main) Resume **
onAuthStateChanged: com.google.firebase.auth.internal.zzl@4e82a120
SignedIn: Stefano Di Chiano
AKXb0iY01ORBY88qFdYap3kvBlP2
Error occurred on line: 41 (Starter)
java.lang.NullPointerException
at anywheresoftware.b4a.BA.addLogPrefix(BA.java:587)
at anywheresoftware.b4a.keywords.Common.LogImpl(Common.java:191)
at b4a.logintest.starter._auth_signedin(starter.java:162)
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:348)
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 anywheresoftware.b4a.BA$2.run(BA.java:370)
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)
signInWithCredential complete: true
I'm using B4A version 9.80.
If needed, this is my manifest:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="28"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.DarkTheme)
'End of default text.
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseAuth.FirebaseAuth)
'************ Facebook Login ****************
AddApplicationText( <activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>)
'************ Facebook Login (end) **********
CreateResource(values, facebook.xml, <resources>
<string name="facebook_app_id">509085083330445</string>
</resources>)
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="28"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.DarkTheme)
'End of default text.
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseAuth.FirebaseAuth)
'************ Facebook Login ****************
AddApplicationText( <activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>)
'************ Facebook Login (end) **********
CreateResource(values, facebook.xml, <resources>
<string name="facebook_app_id">509085083330445</string>
</resources>)