firebase.login error
See original GitHub issueHello there,
I’m using firebase with the last version of nativescript (2.1.1), and I get an error when I try to login:
JS: Error in firebase.login: Error: java.lang.NullPointerException: Attempt to invoke virtual method ‘android.content.pm.PackageManager android.content.Context.getPackageManager()’ on a null object reference JS: com.google.android.gms.common.zze.isGooglePlayServicesAvailable(Unknown Source) JS: com.google.android.gms.common.zzc.isGooglePlayServicesAvailable(Unknown Source) JS: com.google.android.gms.common.GoogleApiAvailability.isGooglePlayServicesAvailable(Unknown Source) JS: com.tns.Runtime.runModule(Native Method) JS: com.tns.Runtime.runModule(Runtime.java:241) JS: com.tns.Runtime.run(Runtime.java:235) JS: com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:17) JS: android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1036) JS: android.app.ActivityThread.handleBindApplication(ActivityThread.java:6321) JS: android.app.ActivityThread.access$1800(ActivityThread.java:222) JS: android.app.ActivityThread$H.handleMessage(ActivityThread.java:1861) JS: android.os.Handler.dispatchMessage(Handler.java:102) JS: android.os.Looper.loop(Looper.java:158) JS: android.app.ActivityThread.main(ActivityThread.java:7229) JS: java.lang.reflect.Method.invoke(Native Method) JS: com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) JS: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
I just do this on my “init” promise:
firebase.login({ type: firebase.LoginType.ANONYMOUS }).then( function (result) { console.log('ok'); }, function (errorMessage) { console.log('ko'); } );
I don’t know if it’s related to firebase or this plugin or android?
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
Just in case someone else encounters the same error message when using nativescript-plugin-firebase. If you change the
android:name="com.tns.NativeScriptApplication"
inside the AndroidManifest.xml when enabling multidex for pre lollipop devices this error happens.https://docs.nativescript.org/runtimes/android/advanced-topics/extend-application-activity Instead of using the
android:name=org.myApp.Application
from the example in the link above. Use com.tns.NativeScriptApplication inside of application.android.ts.angular nativescript In build.Gradle deleted multiDexEnabled true and it fixes it