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 'ads' of undefined

See original GitHub issue

Hi, maybe it’s related to last changes with 11.1.1 (I didn’t change anything in my app, just deleted node_modules and install dependencies again) but now I have errors:

Restarting application on device emulator-5554...
Successfully synced application com.pixelcore.voclick on device emulator-5554.
System.err: An uncaught Exception occurred on "main" thread.
System.err: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Error calling module function 
System.err: TypeError: Cannot read property 'ads' of undefined
System.err: File: (file: node_modules\@nativescript\firebase\firebase.android.js:24:0)
System.err: 
System.err: StackTrace:
System.err: ../node_modules/@nativescript/firebase/firebase.js(file: node_modules\@nativescript\firebase\firebase.android.js:24:0)
System.err:     at __webpack_require__(file: src\webpack\bootstrap:74:0)
System.err:     at ./app/core/services/auth/auth.service.ts(file:///data/data/com.pixelcore.voclick/files/app/bundle.js:1693:80)
System.err:     at __webpack_require__(file: src\webpack\bootstrap:74:0)
System.err:     at ./app/core/security/can-activate.guard.ts(file:///data/data/com.pixelcore.voclick/files/app/bundle.js:1236:85)
System.err:     at __webpack_require__(file: src\webpack\bootstrap:74:0)
System.err:     at ./app/app.common.ts(file: src\app\app.common.ts:4:0)
System.err:     at __webpack_require__(file: src\webpack\bootstrap:74:0)
System.err:     at ./app/app.module.tns.ts(file: src\app\app.module.tns.ts:1:0)
System.err:     at __webpack_require__(file: src\webpack\bootstrap:74:0)
System.err:     at (file: src\main.tns.ts:1:106)
System.err:     at ./main.tns.ts(file:///data/data/com.pixelcore.voclick/files/app/bundle.js:6544:30)
System.err:     at __webpack_require__(file: src\webpack\bootstrap:74:0)
System.err:     at checkDeferredModules(file: src\webpack\bootstrap:43:0)
System.err:     at webpackJsonpCallback(file: src\webpack\bootstrap:30:0)
System.err:     at (file:///data/data/com.pixelcore.voclick/files/app/bundle.js:2:57)
System.err:     at require(:1:266)
System.err:
System.err:
System.err: TypeError: Cannot read property 'ads' of undefined
System.err: 
System.err: StackTrace:
System.err: java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Error calling module function      
System.err: TypeError: Cannot read property 'ads' of undefined
System.err: File: (file: node_modules\@nativescript\firebase\firebase.android.js:24:0)
System.err: 
System.err: StackTrace:
System.err: ../node_modules/@nativescript/firebase/firebase.js(file: node_modules\@nativescript\firebase\firebase.android.js:24:0)
System.err:     at __webpack_require__(file: src\webpack\bootstrap:74:0)
System.err:     at ./app/core/services/auth/auth.service.ts(file:///data/data/com.pixelcore.voclick/files/app/bundle.js:1693:80)
System.err:     at __webpack_require__(file: src\webpack\bootstrap:74:0)
System.err:     at ./app/core/security/can-activate.guard.ts(file:///data/data/com.pixelcore.voclick/files/app/bundle.js:1236:85)
System.err:     at __webpack_require__(file: src\webpack\bootstrap:74:0)
System.err:     at ./app/app.common.ts(file: src\app\app.common.ts:4:0)
System.err:     at __webpack_require__(file: src\webpack\bootstrap:74:0)
System.err:     at ./app/app.module.tns.ts(file: src\app\app.module.tns.ts:1:0)
System.err:     at __webpack_require__(file: src\webpack\bootstrap:74:0)
System.err:     at (file: src\main.tns.ts:1:106)
System.err:     at ./main.tns.ts(file:///data/data/com.pixelcore.voclick/files/app/bundle.js:6544:30)
System.err:     at __webpack_require__(file: src\webpack\bootstrap:74:0)
System.err:     at checkDeferredModules(file: src\webpack\bootstrap:43:0)
System.err:     at webpackJsonpCallback(file: src\webpack\bootstrap:30:0)
System.err:     at (file:///data/data/com.pixelcore.voclick/files/app/bundle.js:2:57)
System.err:     at require(:1:266)
System.err:
System.err:
System.err: TypeError: Cannot read property 'ads' of undefined
System.err:     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5743)
System.err:     at android.app.ActivityThread.-wrap1(Unknown Source:0)
System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
System.err:     at android.os.Handler.dispatchMessage(Handler.java:106)
System.err:     at android.os.Looper.loop(Looper.java:164)
System.err:     at android.app.ActivityThread.main(ActivityThread.java:6494)
System.err:     at java.lang.reflect.Method.invoke(Native Method)
System.err:     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
System.err: Caused by: com.tns.NativeScriptException: Error calling module function 
System.err: TypeError: Cannot read property 'ads' of undefined
System.err: File: (file: node_modules\@nativescript\firebase\firebase.android.js:24:0)
System.err:
System.err: StackTrace: 
System.err: ../node_modules/@nativescript/firebase/firebase.js(file: node_modules\@nativescript\firebase\firebase.android.js:24:0)
System.err:     at __webpack_require__(file: src\webpack\bootstrap:74:0)
System.err:     at ./app/core/services/auth/auth.service.ts(file:///data/data/com.pixelcore.voclick/files/app/bundle.js:1693:80)
System.err:     at __webpack_require__(file: src\webpack\bootstrap:74:0)
System.err:     at ./app/core/security/can-activate.guard.ts(file:///data/data/com.pixelcore.voclick/files/app/bundle.js:1236:85)
System.err:     at __webpack_require__(file: src\webpack\bootstrap:74:0)
System.err:     at ./app/app.common.ts(file: src\app\app.common.ts:4:0)
System.err:     at __webpack_require__(file: src\webpack\bootstrap:74:0)
System.err:     at ./app/app.module.tns.ts(file: src\app\app.module.tns.ts:1:0)
System.err:     at __webpack_require__(file: src\webpack\bootstrap:74:0)
System.err:     at (file: src\main.tns.ts:1:106)
System.err:     at ./main.tns.ts(file:///data/data/com.pixelcore.voclick/files/app/bundle.js:6544:30)
System.err:     at __webpack_require__(file: src\webpack\bootstrap:74:0)
System.err:     at checkDeferredModules(file: src\webpack\bootstrap:43:0)
System.err:     at webpackJsonpCallback(file: src\webpack\bootstrap:30:0)
System.err:     at (file:///data/data/com.pixelcore.voclick/files/app/bundle.js:2:57)
System.err:     at require(:1:266)
System.err: 
System.err:
System.err: TypeError: Cannot read property 'ads' of undefined
System.err:     at com.tns.Runtime.runModule(Native Method)
System.err:     at com.tns.Runtime.runModule(Runtime.java:689)
System.err:     at com.tns.Runtime.run(Runtime.java:681)
System.err:     at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
System.err:     at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1119)
System.err:     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5740)
System.err:     ... 8 more

Any idea?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:21 (11 by maintainers)

github_iconTop GitHub Comments

4reactions
darkyeloxcommented, Feb 15, 2021

This still happening on 11.1.3 in Android only, have to downgrade to 11.1.2 and worked

3reactions
nikoTMcommented, Nov 3, 2020

@Arystosedes "@nativescript/firebase": "^11.1.0", will install latest if you run tns install, what does npm ls --depth=0 | grep firebase return?

  1. ns platform remove android
  2. npm i @nativescript/firebase@11.1.0
  3. ns debug android

Worked for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

firebase.init() keeps crashing on new NativeScript 8.2.3 App
This seems to be the solution but unfortuately it doesn't work for me. I keep getting Error: Cannot read property 'initializeApp' of undefined....
Read more >
A brand new website interface for an even better experience!
Cannot read property 'ads' of undefined.
Read more >
Uncaught TypeError: Cannot read property 'right' of undefined
VM19758:1 Uncaught TypeError: Cannot read property 'right' of undefined. The error keeps repeating, into the thousands. Content video plays but the IMA ad ......
Read more >
Cannot read property 'ReportRequestId' of undefined
Cannot read property 'ReportRequestId' of undefined. Getting undefined report when trying to generate a report using SubmitGenerateReport.
Read more >
Uncaught TypeError: Cannot read properties of undefined ...
This is clear but the error could be likely caused by a conflicting theme or plugin clashing with the latest code from Google...
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