Hola que tal, tengo los siguientes errores al poner el codigo de este video y no puedo inicializar firebase, segui la clase al pie de la letra asi que no se que este haciendo mal. Aqui adjunto mis errores de la consola y codigo:
[NSDebugAdapter] Ready to attach to application on 40001
JS: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
System.err: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.codeeasy.EventosFacilito/com.tns.NativeScriptActivity}: com.tns.NativeScriptException:
System.err: Calling js method onCreate failed
System.err:
System.err: TypeError: Cannot read property 'getInstance' of undefined
System.err: File: "file:///data/data/com.codeeasy.EventosFacilito/files/app/tns_modules/nativescript-plugin-firebase/firebase.js, line: 288, column: 73
System.err:
System.err: StackTrace:
System.err: Frame: function:'runInit', file:'file:///data/data/com.codeeasy.EventosFacilito/files/app/tns_modules/nativescript-plugin-firebase/firebase.js', line: 288, column: 74
System.err: Frame: function:'Observable.notify', file:'file:///data/data/com.codeeasy.EventosFacilito/files/app/tns_modules/tns-core-modules/data/observable/observable.js', line: 110, column: 23
System.err: Frame: function:'notifyLaunch', file:'file:///data/data/com.codeeasy.EventosFacilito/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 872, column: 17
System.err: Frame: function:'ActivityCallbacksImplementation.setActivityContent', file:'file:///data/data/com.codeeasy.EventosFacilito/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 805, column: 28
System.err: Frame: function:'ActivityCallbacksImplementation.onCreate', file:'file:///data/data/com.codeeasy.EventosFacilito/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 679, column: 14
System.err: Frame: function:'NativeScriptActivity.onCreate', file:'file:///data/data/com.codeeasy.EventosFacilito/files/app/tns_modules/tns-core-modules/ui/frame/activity.js', line: 20, column: 25
System.err:
System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2659)
System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2724)
System.err: at android.app.ActivityThread.-wrap12(ActivityThread.java)
System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1473)
System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
System.err: at android.os.Looper.loop(Looper.java:154)
System.err: at android.app.ActivityThread.main(ActivityThread.java:6123)
System.err: at java.lang.reflect.Method.invoke(Native Method)
System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)
System.err: Caused by: com.tns.NativeScriptException:
System.err: Calling js method onCreate failed
System.err:
System.err: TypeError: Cannot read property 'getInstance' of undefined
System.err: File: "file:///data/data/com.codeeasy.EventosFacilito/files/app/tns_modules/nativescript-plugin-firebase/firebase.js, line: 288, column: 73
System.err:
System.err: StackTrace:
System.err: Frame: function:'runInit', file:'file:///data/data/com.codeeasy.EventosFacilito/files/app/tns_modules/nativescript-plugin-firebase/firebase.js', line: 288, column: 74
System.err: Frame: function:'Observable.notify', file:'file:///data/data/com.codeeasy.EventosFacilito/files/app/tns_modules/tns-core-modules/data/observable/observable.js', line: 110, column: 23
System.err: Frame: function:'notifyLaunch', file:'file:///data/data/com.codeeasy.EventosFacilito/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 872, column: 17
System.err: Frame: function:'ActivityCallbacksImplementation.setActivityContent', file:'file:///data/data/com.codeeasy.EventosFacilito/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 805, column: 28
System.err: Frame: function:'ActivityCallbacksImplementation.onCreate', file:'file:///data/data/com.codeeasy.EventosFacilito/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 679, column: 14
System.err: Frame: function:'NativeScriptActivity.onCreate', file:'file:///data/data/com.codeeasy.EventosFacilito/files/app/tns_modules/tns-core-modules/ui/frame/activity.js', line: 20, column: 25
System.err:
System.err: at com.tns.Runtime.callJSMethodNative(Native Method)
System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1116)
System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:996)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:983)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:967)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:959)
System.err: at com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:18)
System.err: at android.app.Activity.performCreate(Activity.java:6672)
System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1140)
System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2612)
System.err: ... 9 more ```
# main.ts:
// this import should be first in order to load some required settings (like globals and reflect-metadata) import { platformNativeScriptDynamic } from "nativescript-angular/platform";
import { AppModule } from "./app.module";
import firebase = require("nativescript-plugin-firebase");
// A traditional NativeScript application starts by initializing global objects, setting up global CSS rules, creating, and navigating to the main page. // Angular applications need to take care of their own initialization: modules, components, directives, routes, DI providers. // A NativeScript Angular app needs to make both paradigms work together, so we provide a wrapper platform object, platformNativeScriptDynamic, // that sets up a NativeScript application and can bootstrap the Angular framework.
firebase.init({ persist: false }).then(instance => console.log("Firebase iniciado")) .catch(err => console.log("Firebase error:" + err));
platformNativeScriptDynamic().bootstrapModule(AppModule); ```
firebase.nativescript.json:{
"using_ios": false,
"using_android": true,
"firestore": false,
"realtimedb": true,
"authentication": false,
"remote_config": false,
"messaging": true,
"crashlytics": false,
"crash_reporting": false,
"storage": false,
"facebook_auth": false,
"google_auth": false,
"admob": false,
"invites": false,
"dynamic_links": false,
"ml_kit": false
}