hansemannn / titanium-firebase-auth

Use the Firebase Autentication SDK in Axway Titanium 🚀

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

google.firebase.auth.FirebaseAuth.signInWithEmailAndPassword gives exception as on a null object reference

amo222lpatil opened this issue · comments

On android I'm using:

TiSDK 7.2.0.GA
firebase.core 2.2.0
firebase.auth 1.0.1
ti.playservices 11.0.40
hyperloop 3.0.5
Alloy project

index.js

var Firebase = require('firebase.core');
Firebase.configure({file:"google-services.json"});
var FirebaseAuth = require('firebase.auth');
FirebaseAuth.signInWithEmail({
    email : 'abc.xyx@pqr.com',
    password : '********',
    callback : function(e) {
        Titanium.API.trace("[index] >> in callback funtion ");
        if (!e.success) {
            Ti.API.error('Error: ' + e.error);
            return;
        }
        Ti.API.info('Success!');
        Ti.API.info(e.user);
    }
});

It gives error as

[ERROR] : TiExceptionHandler: (main) [0,130] - Message: Uncaught Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.firebase.auth.FirebaseAuth.signInWithEmailAndPassword(java.lang.String, java.lang.String)' on a null object reference
[ERROR] : TiExceptionHandler: (main) [0,130] - Source: FirebaseAuth.signInWithEmail({
[ERROR] : V8Exception: Exception occurred at /alloy/controllers/index.js:81: Uncaught Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.firebase.auth.FirebaseAuth.signInWithEmailAndPassword(java.lang.String, java.lang.String)' on a null object reference
[ERROR] : V8Exception: Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.firebase.auth.FirebaseAuth.signInWithEmailAndPassword(java.lang.String, java.lang.String)' on a null object reference

when i try on android device.

This looks like the native mAuth instance has not been initialized at the time calling this. You need to make sure you app finished launching before using any Firebase API's, e.g. listening to your root-window's open event.

Sorry, but the format is still unacceptable. Use code-highlighting and proper log format for this to be debugged.

Sorry, you are just repeating your environment and pasting unformatted code. You also did not answer my questions about calling the methods from the correct state, so I will be unable to help.

On android I'm using:

Ti SDK : 7.2.0.GA
firebase.core : 2.2.0
firebase.auth : 1.0.1
ti.playservices : 11.0.40
hyperloop : 3.0.5
Alloy project

index.xml

<Alloy>
	<Window id="mainWin">
		<View id="mainView">
			<Button id="loginButton" onClick="login">Login</Button>
		</View>
	</Window>
</Alloy>

index.js

$.mainWin.open();
function login() {
	Ti.API.info("[index] >> [login]");
	
         Ti.API.info("[index] >> [login] >> before Requiring firbase.core");
	var Firebase = require('firebase.core');
	Firebase.configure();

	Ti.API.info("[index] >> [login] >> after configure firbase.core ");
	var FirebaseAuth = require('firebase.auth');
	Ti.API.info("[index] >> [login] >> After requiring firbase.auth");
	
         Ti.API.info("[index] >> [login] >> FirbaseAuth vaariable contains : " + JSON.stringify(FirebaseAuth));

	Ti.API.info("[index] >> [login] >> calling to signINWithEmail");
	FirebaseAuth.signInWithEmail({
		email : 'dfjkdnskj@fjndjfk.com',
		password : '*********',
		callback : function(e) {
			Ti.API.info("[index] >> [login] >> in callback.");
			if (!e.success) {
				Ti.API.error('Error: ' + e.error);
				return;
			}

			Ti.API.info('Success!');
			Ti.API.info(e.user);
		}
	});
}

I called login method after login button is pressed. I do Firebase API's call after app finished launching.
then also it given error below:

-- Start application log -----------------------------------------------------
[INFO] :   TiApplication: (main) [0,0] checkpoint, app created.
[INFO] :   TiApplication: (main) [65,65] Titanium 7.1.0 (2018/03/14 13:40 undefined)
[INFO] :   MultiDex: VM with version 2.1.0 has multidex support
[INFO] :   MultiDex: install
[INFO] :   MultiDex: VM has multidex support, MultiDex support library is disabled.
[WARN] :   TiAndroid: (main) [1162,1227] Application instance no longer available. Unable to get current activity.
[WARN] :   TiAndroid: (main) [1,1228] Application instance no longer available. Unable to get current activity.
[WARN] :   TiAndroid: (main) [0,1228] Application instance no longer available. Unable to get current activity.
[INFO] :   TiApplication: (main) [31,1259] Titanium Javascript runtime: v8
[INFO] :   TiRootActivity: (main) [0,0] checkpoint, on root activity create, savedInstanceState: null
[INFO] :   DpmTcmClient: RegisterTcmMonitor from: com.android.okhttp.TcmIdleTimerMonitor
[INFO] :   TiRootActivity: (main) [0,0] checkpoint, on root activity resume. activity = com.mindstix.googleAuth.GoogleauthActivity@7c2e
[INFO] :   Adreno: QUALCOMM build                   : 7a841e6, I43097da1fb
[INFO] :   Adreno: Build Date                       : 05/10/16
[INFO] :   Adreno: OpenGL ES Shader Compiler Version: XE031.06.00.02
[INFO] :   Adreno: Local Branch                     : mybranch19687176
[INFO] :   Adreno: Remote Branch                    : quic/LA.BR.1.3.3.c4
[INFO] :   Adreno: Remote Branch                    : NONE
[INFO] :   Adreno: Reconstruct Branch               : NOTHING
[INFO] :   OpenGLRenderer: Initialized EGL, version 1.4
[INFO] :   ACS Login Results for environment `development`:
[INFO] :   [object Object]
[TRACE] :  updating tiapp metadata with Appcelerator Platform...
[TRACE] :  Uploaded tiapp metadata with Appcelerator Platform!
[INFO] :   ViewRootImpl: finishMotionEvent: handled = true stage=10: View Post IME stage,inputElapseTime=2 eventTime = 3536490 downTime = 3536490 title= com.mindstix.googleAuth/org.appcelerator.titanium.TiActivity
[INFO] :   ViewRootImpl: finishMotionEvent: handled = true stage=10: View Post IME stage,inputElapseTime=1 eventTime = 3539173 downTime = 3539173 title= com.mindstix.googleAuth/org.appcelerator.titanium.TiActivity
[INFO] :   [index] >> [login]
[INFO] :   [index] >> [login] >> before Requiring firbase.core
[INFO] :   [index] >> [login] >> after configure firbase.core
[INFO] :   [index] >> [login] >> After requiring firbase.auth
[INFO] :   [index] >> [login] >> FirbaseAuth variable contains : {}
[INFO] :   [index] >> [login] >> calling to signInWithEmail
[WARN] :   W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.firebase.auth.FirebaseAuth.signInWithEmailAndPassword(java.lang.String, java.lang.String)' on a null object reference
[WARN] :   W/System.err: 	at firebase.auth.TitaniumFirebaseAuthModule.signInWithEmail(TitaniumFirebaseAuthModule.java:141)
[WARN] :   W/System.err: 	at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method)
[WARN] :   W/System.err: 	at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:63)
[WARN] :   W/System.err: 	at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:962)
[WARN] :   W/System.err: 	at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1186)
[WARN] :   W/System.err: 	at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:394)
[WARN] :   W/System.err: 	at android.os.Handler.dispatchMessage(Handler.java:98)
[WARN] :   W/System.err: 	at android.os.Looper.loop(Looper.java:148)
[WARN] :   W/System.err: 	at android.app.ActivityThread.main(ActivityThread.java:5582)
[WARN] :   W/System.err: 	at java.lang.reflect.Method.invoke(Native Method)
[WARN] :   W/System.err: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726
[WARN] :   W/System.err: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
[ERROR] :  TiExceptionHandler: (main) [10909,10909] ----- Titanium Javascript Runtime Error -----
[ERROR] :  TiExceptionHandler: (main) [0,10909] - In /alloy/controllers/index.js:71,18
[ERROR] :  TiExceptionHandler: (main) [0,10909] - Message: Uncaught Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.firebase.auth.FirebaseAuth.signInWithEmailAndPassword(java.lang.String, java.lang.String)' on a null object reference
[ERROR] :  TiExceptionHandler: (main) [0,10909] - Source:     FirebaseAuth.signInWithEmail({
[ERROR] :  V8Exception: Exception occurred at /alloy/controllers/index.js:71: Uncaught Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.firebase.auth.FirebaseAuth.signInWithEmailAndPassword(java.lang.String, java.lang.String)' on a null object reference

On android I'm using:

_Ti SDK : 7.2.0.GA
firebase.core : 2.2.0
firebase.auth : 1.0.2
ti.playservices : 11.0.40
hyperloop : 3.0.5
Alloy project

index.xml

<Alloy>
	<Window id="mainWin">
		<View id="mainView">
			<Button id="loginButton" onClick="login">Login</Button>
		</View>
	</Window>
</Alloy>

index.js

$.mainWin.open()
function login() {
	Ti.API.info("[index] >> [login]");
	Ti.API.info("[index] >> [login] >> before Requiring firbase.core");
	var Firebase = require('firebase.core');
	Firebase.configure();
	Ti.API.info("[index] >> [login] >> Firbase variable contains : " + JSON.stringify(Firebase));
	Ti.API.info("[index] >> [login] >> after configure firbase.core ");
	var FirebaseAuth = require('firebase.auth');
	Ti.API.info("[index] >> [login] >> FirbaseAuth variable contains : " + JSON.stringify(FirebaseAuth));
	Ti.API.info("[index] >> [login] >> After requiring firbase.auth");
	Ti.API.info("[index] >> [login] >> FirbaseAuth variable contains : " + JSON.stringify(FirebaseAuth));
	Ti.API.info("[index] >> [login] >> calling to signINWithEmail");
	FirebaseAuth.signInWithEmail({
		email : 'dkjfhdskjfkj@com',
		password : '***********',
		callback : function(e) {
			Ti.API.info("[index] >> [login] >> in callback.");
			if (!e.success) {
				Ti.API.error('Error: ' + e.error);
				return;
			}
			Ti.API.info('Success!');
			Ti.API.info(e.user);
	         }
	});
}

I used firebase.auth-android-1.0.2 then it given below error

-- Start application log -----------------------------------------------------
[INFO] :   TiApplication: (main) [0,0] checkpoint, app created.
[INFO] :   TiApplication: (main) [59,59] Titanium 7.0.0 (2017/12/05 13:30 undefined)
[INFO] :   MultiDex: VM with version 2.1.0 has multidex support
[INFO] :   MultiDex: install
[INFO] :   MultiDex: VM has multidex support, MultiDex support library is disabled.
[WARN] :   TiAndroid: (main) [1090,1149] Application instance no longer available. Unable to get current activity.
[WARN] :   TiAndroid: (main) [2,1151] Application instance no longer available. Unable to get current activity.
[WARN] :   TiAndroid: (main) [0,1151] Application instance no longer available. Unable to get current activity.
[INFO] :   TiApplication: (main) [24,1175] Titanium Javascript runtime: v8
[INFO] :   TiRootActivity: (main) [0,0] checkpoint, on root activity create, savedInstanceState: null
[INFO] :   DpmTcmClient: RegisterTcmMonitor from: com.android.okhttp.TcmIdleTimerMonitor
[INFO] :   TiRootActivity: (main) [0,0] checkpoint, on root activity resume. activity = com.mindstix.googleAuth.GoogleauthActivity@7c2e
[INFO] :   Adreno: QUALCOMM build                   : 7a841e6, I43097da1fb
[INFO] :   Adreno: Build Date                       : 05/10/16
[INFO] :   Adreno: OpenGL ES Shader Compiler Version: XE031.06.00.02
[INFO] :   Adreno: Local Branch                     : mybranch19687176
[INFO] :   Adreno: Remote Branch                    : quic/LA.BR.1.3.3.c4
[INFO] :   Adreno: Remote Branch                    : NONE
[INFO] :   Adreno: Reconstruct Branch               : NOTHING
[INFO] :   OpenGLRenderer: Initialized EGL, version 1.4
[INFO] :   ACS Login Results for environment `development`:
[INFO] :   [object Object]
[TRACE] :  updating tiapp metadata with Appcelerator Platform...
[TRACE] :  Uploaded tiapp metadata with Appcelerator Platform!
[INFO] :   APSAnalyticsService: Analytics Service Started
[INFO] :   APSAnalyticsService: Stopping Analytics Service
[INFO] :   ViewRootImpl: finishMotionEvent: handled = true stage=10: View Post IME stage,inputElapseTime=2 eventTime = 17116417 downTime = 17116417 title= com.mindstix.googleAuth/org.appcelerator.titanium.TiActivity
[INFO] :   [index] >> [login]
[INFO] :   [index] >> [login] >> before Requiring firbase.core
[INFO] :   [index] >> [login] >> Firbase variable contains : {}
[INFO] :   [index] >> [login] >> after configure firbase.core
[INFO] :   [index] >> [login] >> FirbaseAuth variable contains : {}
[INFO] :   [index] >> [login] >> After requiring firbase.auth
[INFO] :   [index] >> [login] >> FirbaseAuth variable contains : {}
[INFO] :   [index] >> [login] >> calling to signINWithEmail
[WARN] :   W/System.err: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.mindstix.googleAuth. Make sure to call FirebaseApp.initializeApp(Context) first.
[WARN] :   W/System.err: at com.google.firebase.FirebaseApp.getInstance(Unknown Source)
[WARN] :   W/System.err: at com.google.firebase.auth.FirebaseAuth.getInstance(Unknown Source)
[WARN] :   W/System.err: at firebase.auth.TitaniumFirebaseAuthModule.authInstance(TitaniumFirebaseAuthModule.java:74)
[WARN] :   W/System.err: at firebase.auth.TitaniumFirebaseAuthModule.signInWithEmail(TitaniumFirebaseAuthModule.java:141)
[WARN] :   W/System.err: at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method)
[WARN] :   W/System.err: at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62)
[WARN] :   W/System.err: at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:934)
[WARN] :   W/System.err: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1157)
[WARN] :   W/System.err: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:363)
[WARN] :   W/System.err: at android.os.Handler.dispatchMessage(Handler.java:98)
[WARN] :   W/System.err: at android.os.Looper.loop(Looper.java:148)
[WARN] :   W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5582)
[WARN] :   W/System.err: at java.lang.reflect.Method.invoke(Native Method)
[WARN] :   W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
[WARN] :   W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
[ERROR] :  TiExceptionHandler: (main) [54240,54240] ----- Titanium Javascript Runtime Error -----
[ERROR] :  TiExceptionHandler: (main) [0,54240] - In /alloy/controllers/index.js:138,16
[ERROR] :  TiExceptionHandler: (main) [0,54240] - Message: Uncaught Default FirebaseApp is not initialized in this process com.mindstix.googleAuth. Make sure to call FirebaseApp.initializeApp(Context) first.
[ERROR] :  TiExceptionHandler: (main) [0,54240] - Source: FirebaseAuth.signInWithEmail({
[ERROR] :  V8Exception: Exception occurred at /alloy/controllers/index.js:138: Uncaught Default FirebaseApp is not initialized in this process com.mindstix.googleAuth. Make sure to call FirebaseApp.initializeApp(Context) first.
[ERROR] :  V8Exception: Default FirebaseApp is not initialized in this process com.mindstix.googleAuth. Make sure to call FirebaseApp.initializeApp(Context) first.

Your firebase project is not properly configured. It seems like you need to read the docs more carefully, especially this and this.

Can you please send any sample alloy project running on android with firebase authentication ?

I using same above environment configuration. I changes FirebaseCore.configure() method parameter as specified by you. same code running on ios without any error with proper functionality but on android device it given following error.

index.xml

<Alloy>
	<Window id="mainWin">
		<View id="mainView">
			<Button id="loginButton" onClick="login">Login</Button>
		</View>
	</Window>
</Alloy>

index.js

$.mainWin.open()
function login() {
	Ti.API.info("[index] >> [login]");
	Ti.API.info("[index] >> [login] >> before Requiring firbase.core");
	var FirebaseCore = require('firebase.core');
	FirebaseCore.configure({
		APIKey : "AIzaSyAzJHxo_0H3uZJ5TSOtG43GACql938lY-0",
		projectID : "test-a3a97",
		storageBucket : "test-a3a97.appspot.com",
		applicationID : "1:497419466008:android:cac9b33a3e5f19ec"
	});
	Ti.API.info("[index] >> [login] >> Firbase variable contains : " + JSON.stringify(FirebaseCore));

	Ti.API.info("[index] >> [login] >> after configure firbase.core ");
	var FirebaseAuth = require('firebase.auth');

	Ti.API.info("[index] >> [login] >> FirbaseAuth variable contains : " + JSON.stringify(FirebaseAuth));

	Ti.API.info("[index] >> [login] >> After requiring firbase.auth");
	Ti.API.info("[index] >> [login] >> FirbaseAuth variable contains : " + JSON.stringify(FirebaseAuth));

	Ti.API.info("[index] >> [login] >> calling to signInWithEmail");
	FirebaseAuth.signInWithEmail({
		email : 'jdfnsdkf@jddjsk.com',
		password : '**********',
		callback : function(e) {
			Ti.API.info("[index] >> [login] >> in callback."+JSON.stringify(e));
			if (!e.success) {
				Ti.API.error('Error: ' + e.error);
				return;
			}

			Ti.API.info('Success!');
			Ti.API.info(e.user);
		}
	});

}

Error

-- Start application log -----------------------------------------------------
[INFO] :   TiApplication: (main) [0,0] checkpoint, app created.
[INFO] :   TiApplication: (main) [63,63] Titanium 7.0.0 (2017/12/05 13:30 undefined)
[INFO] :   MultiDex: VM with version 2.1.0 has multidex support
[INFO] :   MultiDex: install
[INFO] :   MultiDex: VM has multidex support, MultiDex support library is disabled.
[WARN] :   TiAndroid: (main) [1185,1248] Application instance no longer available. Unable to get current activity.
[WARN] :   TiAndroid: (main) [1,1249] Application instance no longer available. Unable to get current activity.
[WARN] :   TiAndroid: (main) [1,1250] Application instance no longer available. Unable to get current activity.
[INFO] :   TiApplication: (main) [31,1281] Titanium Javascript runtime: v8
[INFO] :   TiRootActivity: (main) [0,0] checkpoint, on root activity create, savedInstanceState: null
[INFO] :   DpmTcmClient: RegisterTcmMonitor from: com.android.okhttp.TcmIdleTimerMonitor
[INFO] :   TiRootActivity: (main) [0,0] checkpoint, on root activity resume. activity = com.mindstix.googleAuth.GoogleauthActivity@7c2e
[INFO] :   Adreno: QUALCOMM build                   : 7a841e6, I43097da1fb
[INFO] :   Adreno: Build Date                       : 05/10/16
[INFO] :   Adreno: OpenGL ES Shader Compiler Version: XE031.06.00.02
[INFO] :   Adreno: Local Branch                     : mybranch19687176
[INFO] :   Adreno: Remote Branch                    : quic/LA.BR.1.3.3.c4
[INFO] :   Adreno: Remote Branch                    : NONE
[INFO] :   Adreno: Reconstruct Branch               : NOTHING
[INFO] :   OpenGLRenderer: Initialized EGL, version 1.4
[TRACE] :  updating tiapp metadata with Appcelerator Platform...
[INFO] :   ACS Login Results for environment `development`:
[INFO] :   [object Object]
[TRACE] :  Uploaded tiapp metadata with Appcelerator Platform!
[INFO] :   ActivityThreadEui: handleSleeping sleeping=true screenOn=false
[INFO] :   ActivityThreadEui: handleSleeping sleeping=true screenOn=false
[INFO] :   ActivityThreadEui: handleSleeping sleeping=false screenOn=true
[INFO] :   ActivityThreadEui: handleSleeping sleeping=false screenOn=true
[INFO] :   ViewRootImpl: finishMotionEvent: handled = true stage=10: View Post IME stage,inputElapseTime=3 eventTime = 36749921 downTime = 36749921 title= com.mindstix.googleAuth/org.appcelerator.titanium.TiActivity
[INFO] :   ViewRootImpl: finishMotionEvent: handled = true stage=10: View Post IME stage,inputElapseTime=1 eventTime = 36750896 downTime = 36750896 title= com.mindstix.googleAuth/org.appcelerator.titanium.TiActivity
[INFO] :   [index] >> [login]
[INFO] :   [index] >> [login] >> before Requiring firbase.core
[WARN] :   DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
[ERROR] :  FirebaseInstanceId: Failed to resolve target intent service, skipping classname enforcement
[ERROR] :  FirebaseInstanceId: Error while delivering the message: ServiceIntent not found.
[INFO] :   [index] >> [login] >> Firbase variable contains : {}
[INFO] :   [index] >> [login] >> after configure firbase.core
[WARN] :   DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
[INFO] :   [index] >> [login] >> FirbaseAuth variable contains : {}
[INFO] :   [index] >> [login] >> After requiring firbase.auth
[INFO] :   [index] >> [login] >> FirbaseAuth variable contains : {}
[INFO] :   [index] >> [login] >> calling to signInWithEmail
[INFO] :   APSAnalyticsService: Analytics Service Started
[ERROR] :  TiApplication: (main) [44682,44682] Sending event: exception on thread: main msg:java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.net.Uri.toString()' on a null object reference; Titanium 7.2.0,2017/12/05 13:30,undefined
[ERROR] :  TiApplication: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.net.Uri.toString()' on a null object reference
[ERROR] :  TiApplication: 	at firebase.auth.TitaniumFirebaseAuthModule.dictionaryFromUser(TitaniumFirebaseAuthModule.java:295)
[ERROR] :  TiApplication: 	at firebase.auth.TitaniumFirebaseAuthModule.access$000(TitaniumFirebaseAuthModule.java:36)
[ERROR] :  TiApplication: 	at firebase.auth.TitaniumFirebaseAuthModule$4.onSuccess(TitaniumFirebaseAuthModule.java:150)
[ERROR] :  TiApplication: 	at firebase.auth.TitaniumFirebaseAuthModule$4.onSuccess(TitaniumFirebaseAuthModule.java:144)
[ERROR] :  TiApplication: 	at com.google.android.gms.tasks.zzj.run(Unknown Source)
[ERROR] :  TiApplication: 	at android.os.Handler.handleCallback(Handler.java:739)
[ERROR] :  TiApplication: 	at android.os.Handler.dispatchMessage(Handler.java:95)
[ERROR] :  TiApplication: 	at android.os.Looper.loop(Looper.java:148)
[ERROR] :  TiApplication: 	at android.app.ActivityThread.main(ActivityThread.java:5582)
[ERROR] :  TiApplication: 	at java.lang.reflect.Method.invoke(Native Method)
[ERROR] :  TiApplication: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
[ERROR] :  TiApplication: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
[INFO] :   APSAnalyticsService: Stopping Analytics Service

Can you please send any sample alloy project running on android with firebase authentication ?

commented

Did you manage to work this out?
I just ran into the same issue and I'm pretty sure the window has loaded because I'm running the below code on a button click.

	FirebaseAuth.signInWithEmail({
    email: 'john@doe.com',
    password: 't1r0ck$!',
    callback: function(e) {
    if (!e.success) {
      Ti.API.error('Error: ' + e.error);
      return;
    }

    Ti.API.info('Success!');
    Ti.API.info(e.user);
  }
});

UPDATE

Trying 1.0.2 from a previous comment just worked. For future reference, this is what I'm using

        <module platform="android" version="16.1.3">ti.playservices</module>
        <module platform="android" version="5.0.0">firebase.core</module>
        <module platform="android" version="3.0.0">firebase.analytics</module>
        <module platform="android" version="2.0.4">firebase.cloudmessaging</module>
        <module platform="android" version="1.0.2">firebase.auth</module>

Note
To get this to work I did some extra bits:

  • remove the play-services and firebase-common AAR files from the firebase.auth module
  • replace firebase-auth AAR file with version 15.0.0 from here. A version above or below and I'm getting crashes or other errors.