Cannot read property 'firebase' of undefined
See original GitHub issueI added the start-up wiring to my app.vue and i got this error: `An uncaught Exception occurred on “main” thread. java.lang.RuntimeException: Unable to start activity ComponentInfo{org.nativescript.application/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Calling js method onCreate failed
TypeError: Cannot read property ‘firebase’ of undefined File: "file:///data/data/org.nativescript.application/files/app/vendor.js, line: 24374, column: 17
StackTrace: Frame: function:‘runInit’, file:‘file:///data/data/org.nativescript.application/files/app/vendor.js’, line: 24374, column: 18 Frame: function:‘Observable.notify’, file:‘file:///data/data/org.nativescript.application/files/app/vendor.js’, line: 46720, column: 15 Frame: function:‘notifyLaunch’, file:‘file:///data/data/org.nativescript.application/files/app/vendor.js’, line: 68576, column: 15 Frame: function:‘ActivityCallbacksImplementation.setActivityContent’, file:‘file:///data/data/org.nativescript.application/files/app/vendor.js’, line: 68509, column: 20 Frame: function:‘ActivityCallbacksImplementation.onCreate’, file:‘file:///data/data/org.nativescript.application/files/app/vendor.js’, line: 68343, column: 10 Frame: function:‘NativeScriptActivity.onCreate’, file:‘file:///data/data/org.nativescript.application/files/app/vendor.js’, line: 65705, column: 21
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: com.tns.NativeScriptException: Calling js method onCreate failed
TypeError: Cannot read property ‘firebase’ of undefined File: "file:///data/data/org.nativescript.application/files/app/vendor.js, line: 24374, column: 17
StackTrace: Frame: function:‘runInit’, file:‘file:///data/data/org.nativescript.application/files/app/vendor.js’, line: 24374, column: 18 Frame: function:‘Observable.notify’, file:‘file:///data/data/org.nativescript.application/files/app/vendor.js’, line: 46720, column: 15 Frame: function:‘notifyLaunch’, file:‘file:///data/data/org.nativescript.application/files/app/vendor.js’, line: 68576, column: 15 Frame: function:‘ActivityCallbacksImplementation.setActivityContent’, file:‘file:///data/data/org.nativescript.application/files/app/vendor.js’, line: 68509, column: 20 Frame: function:‘ActivityCallbacksImplementation.onCreate’, file:‘file:///data/data/org.nativescript.application/files/app/vendor.js’, line: 68343, column: 10 Frame: function:‘NativeScriptActivity.onCreate’, file:‘file:///data/data/org.nativescript.application/files/app/vendor.js’, line: 65705, column: 21
at com.tns.Runtime.callJSMethodNative(Native Method)
at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1116)
at com.tns.Runtime.callJSMethodImpl(Runtime.java:996)
at com.tns.Runtime.callJSMethod(Runtime.java:983)
at com.tns.Runtime.callJSMethod(Runtime.java:967)
at com.tns.Runtime.callJSMethod(Runtime.java:959)
at com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:18)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Activity.performCreate(Activity.java:7127)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
... 11 more
`
Issue Analytics
- State:
- Created 5 years ago
- Comments:20 (9 by maintainers)
Top GitHub Comments
I understand, but the Preview app ships with a number of plugins, and this is not one of them… so indeed that doesn’t work.
My solution for this issue was to reconfigure the plugin to generate a new
firebase.nativescript.json
file: