question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property 'firebase' of undefined

See original GitHub issue

I 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:closed
  • Created 5 years ago
  • Comments:20 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
EddyVerbruggencommented, Feb 28, 2019

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.

0reactions
rdlauercommented, Sep 23, 2019

My solution for this issue was to reconfigure the plugin to generate a new firebase.nativescript.json file:

You can reconfigure the plugin by going to the node_modules/nativescript-plugin-firebase and running npm run config.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'firebase' of undefined #40
it's seems your code want execute "undefined.firebase". u have many way to get undefined) i thought there something like this: some code try ......
Read more >
Cannot read property 'apps' of undefined firebase - Stack ...
I try lots of ways but I can't solve this. I am using firebase 9.0.1. Server Error TypeError: Cannot read property 'apps' of...
Read more >
firebase-functons Node.js - TypeError: Cannot read property ...
to Firebase Google Group. I'm seing a simple webhook throwing the following error: node.js v8.9.4. TypeError: Cannot read property 'quantity' of undefined.
Read more >
cannot read properties of undefined (reading 'apps') firebase
It seems your code has firebase v8 while you have firebase v9 package and it has completely different import structures. This happen lot...
Read more >
nativescript-firebase-updated-new - npm
Fire. Base. Firebase!. Latest version: 2811.1.2, last published: 7 months ago. Start using nativescript-firebase-updated-new in your project ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found