Closed culda closed 4 years ago
More than happy to debug myself if somebody could share a working set of modules that includes firebase-auth. I just don't have a good reference point and I feel like my versions are bad because I jumped so many hurdles by updating the versions, just not this hurdle.
Update I replaced the old AAR with firebase-auth-15.0.0.aar under the firebase.auth module and I'm getting a different error (feels like progress)
[ERROR] : TiExceptionHandler: (main) [6,178] /app.js:35
[ERROR] : TiExceptionHandler: var currentUser = FirebaseAuth.currentUser();
[ERROR] : TiExceptionHandler: ^
[ERROR] : TiExceptionHandler: Error: Attempt to invoke virtual method 'com.google.firebase.auth.FirebaseUser com.google.firebase.auth.FirebaseAuth.getCurrentUser()' on a null object reference
[ERROR] : TiExceptionHandler: at /app.js:35:32
[ERROR] : TiExceptionHandler: at Module._runScript (ti:/module.js:608:9)
[ERROR] : TiExceptionHandler: at Module.load (ti:/module.js:107:7)
[ERROR] : TiExceptionHandler: at Module.loadJavascriptText (ti:/module.js:453:9)
[ERROR] : TiExceptionHandler: at Module.loadAsFile (ti:/module.js:508:15)
[ERROR] : TiExceptionHandler: at Module.loadAsFileOrDirectory (ti:/module.js:425:20)
[ERROR] : TiExceptionHandler: at Module.require (ti:/module.js:255:17)
[ERROR] : TiExceptionHandler: at Module.global.Module.require (<embedded>:9507:34)
[ERROR] : TiExceptionHandler: at require (ti:/module.js:566:15)
[ERROR] : TiExceptionHandler: at global.require (<embedded>:9491:10)
[ERROR] : TiExceptionHandler:
[ERROR] : TiExceptionHandler: firebase.auth.TitaniumFirebaseAuthModule.getCurrentUser(TitaniumFirebaseAuthModule.java:266)
[ERROR] : TiExceptionHandler: org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method)
[ERROR] : TiExceptionHandler: org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:168)
[ERROR] : TiExceptionHandler: org.appcelerator.kroll.KrollRuntime.runModule(KrollRuntime.java:225)
[ERROR] : TiExceptionHandler: org.appcelerator.titanium.TiLaunchActivity.loadScript(TiLaunchActivity.java:107)
[ERROR] : TiExceptionHandler: org.appcelerator.titanium.TiRootActivity.loadScript(TiRootActivity.java:480)
[ERROR] : TiExceptionHandler: org.appcelerator.titanium.TiLaunchActivity.onResume(TiLaunchActivity.java:192)
[ERROR] : TiExceptionHandler: org.appcelerator.titanium.TiRootActivity.onResume(TiRootActivity.java:499)
[ERROR] : TiExceptionHandler: android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1446)
[ERROR] : TiExceptionHandler: android.app.Activity.performResume(Activity.java:7939)
[ERROR] : V8Exception: Exception occurred at /app.js:35: Uncaught Error: Attempt to invoke virtual method 'com.google.firebase.auth.FirebaseUser com.google.firebase.auth.FirebaseAuth.getCurrentUser()' on a null object reference
I've made a new build and tried every possible version of firebase-auth .aar, still no avail. My current build Titanium 9.0.1
<module platform="android" version="17.1.1">ti.playservices</module>
<module platform="android" version="6.0.0">firebase.core</module>
<module platform="android" version="3.0.0">firebase.analytics</module>
<module platform="android" version="3.0.0">firebase.cloudmessaging</module>
<module platform="android" version="1.0.1">firebase.auth</module>
Using the sample code
var FirebaseAuth = require('firebase.auth');
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);
}
});
Stack trace
[ERROR] : TiExceptionHandler: (main) [25,332] /app.js:37
[ERROR] : TiExceptionHandler: FirebaseAuth.signInWithEmail({
[ERROR] : TiExceptionHandler: ^
[ERROR] : TiExceptionHandler: Error: Failed resolution of: Lcom/google/firebase/internal/InternalTokenProvider;
[ERROR] : TiExceptionHandler: at /app.js:37:14
[ERROR] : TiExceptionHandler: at Module._runScript (ti:/module.js:587:9)
[ERROR] : TiExceptionHandler: at Module.load (ti:/module.js:106:7)
[ERROR] : TiExceptionHandler: at Module.loadJavascriptText (ti:/module.js:436:9)
[ERROR] : TiExceptionHandler: at Module.loadAsFile (ti:/module.js:488:15)
[ERROR] : TiExceptionHandler: at Module.loadAsFileOrDirectory (ti:/module.js:410:20)
[ERROR] : TiExceptionHandler: at Module.require (ti:/module.js:239:23)
[ERROR] : TiExceptionHandler: at Module.global.Module.require (<embedded>:19311:34)
[ERROR] : TiExceptionHandler: at require (ti:/module.js:550:15)
[ERROR] : TiExceptionHandler: at global.require (<embedded>:19295:10)
[ERROR] : TiExceptionHandler:
[ERROR] : TiExceptionHandler: java.lang.Class.newInstance(Native Method)
[ERROR] : TiExceptionHandler: org.appcelerator.kroll.KrollProxy.createProxy(KrollProxy.java:136)
[ERROR] : TiExceptionHandler: org.appcelerator.kroll.runtime.v8.V8Function.nativeInvoke(Native Method)
[ERROR] : TiExceptionHandler: org.appcelerator.kroll.runtime.v8.V8Function.callSync(V8Function.java:55)
[ERROR] : TiExceptionHandler: org.appcelerator.kroll.runtime.v8.V8Function.call(V8Function.java:41)
[ERROR] : TiExceptionHandler: ti.modules.titanium.TitaniumModule$Timer.run(TitaniumModule.java:167)
[ERROR] : TiExceptionHandler: android.os.Handler.handleCallback(Handler.java:883)
[ERROR] : TiExceptionHandler: android.os.Handler.dispatchMessage(Handler.java:100)
[ERROR] : TiExceptionHandler: android.os.Looper.loop(Looper.java:214)
[ERROR] : TiExceptionHandler: android.app.ActivityThread.main(ActivityThread.java:7356)
[ERROR] : V8Exception: Exception occurred at /app.js:37: Uncaught Error: Failed resolution of: Lcom/google/firebase/internal/InternalTokenProvider;
Environment:
Android Titanium 8.3.1 playservices 16.1.3 firebase.core 5.0.0 firebase.analytics 3.0.0 firebase.cloudmessaging 2.0.4 firebase.auth 1.0.1
I tried various version combinations, but all roads lead to this error - which triggers whenever I use any method from the FirebaseAuth object such as currentUser().
It would be awesome if somebody could share a working list of module versions that I could try.
Attaching full console log
console-missing-aad.log