Nativescript-plugin-firebase: TypeError: Cannot read property 'tasks' of undefined

Created on 4 Dec 2019  路  21Comments  路  Source: EddyVerbruggen/nativescript-plugin-firebase

Hi @EddyVerbruggen
I'm reopening this issue again, I'm aware that it was opened by @tobydeh here, I'm not sure if this issue has already been solved, or not yet but I'm facing it and I tried my best to find ways to fix it but no luck.
Please note that When I installed it, I didn't get the installation wizard, I tried reinstalling multiple time but still not getting the wizard, I'm aware if this, and I copied firebase.nativescript.json from your repo

I even tried in fresh Nativescript project (aka test installation) but I still get the same issue. I tested the app with S8+, Pixel 3A, Galaxy J7, all resulted in the following error:

Project is Nativescript JS

An uncaught Exception occurred on "main" thread.
Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Error calling module function 
TypeError: Cannot read property 'tasks' of undefined
File: (file:///data/data/org.nativescript.new/files/app/vendor.js:43284:38)

StackTrace: 
(file:///data/data/org.nativescript.new/files/app/vendor.js:43284:39)
    at ../node_modules/nativescript-plugin-firebase/mlkit/barcodescanning/index.js(file:///data/data/org.nativescript.new/files/app/vendor.js:43456:30)
    at __webpack_require__(file:///data/data/org.nativescript.new/files/app/runtime.js:751:30)
    at fn(file:///data/data/org.nativescript.new/files/app/runtime.js:121:20)
    at (file:///data/data/org.nativescript.new/files/app/vendor.js:44116:23)
    at ../node_modules/nativescript-plugin-firebase/mlkit/index.js(file:///data/data/org.nativescript.new/files/app/vendor.js:44144:30)
    at __webpack_require__(file:///data/data/org.nativescript.new/files/app/runtime.js:751:30)
    at fn(file:///data/data/org.nativescript.new/files/app/runtime.js:121:20)
    at (file:///data/data/org.nativescript.new/files/app/vendor.js:39989:13)
    at ../node_modules/nativescript-plugin-firebase/firebase-common.js(file:///data/data/org.nativescript.new/files/app/vendor.js:40237:30)
    at __webpack_require__(file:///data/data/org.nativescript.new/files/app/runtime.js:751:30)
    at fn(file:///data/data/org.nativescript.new/files/app/runtime.js:121:20)
    at (file:///data/data/org.nativescript.new/files/app/vendor.js:40251:25)
    at ../node_modules/nativescript-plugin-firebase/firebase.js(file:///data/data/org.nativescript.new/files/app/vendor.js:42732:30)
    at __webpack_require__(file:///data/data/org.nativescript.new/files/app/runtime.js:751:30)
    at fn(file:///data/data/org.nativescript.new/files/app/runtime.js:121:20)
    at (file:///data/data/org.nativescript.new/files/app/bundle.js:162:18)
    at ./app.js(file:///data/data/org.nativescript.new/files/app/bundle.js:194:30)
    at __webpack_require__(file:///data/data/org.nativescript.new/files/app/runtime.js:751:30)
    at checkDeferredModules(file:///data/data/org.nativescript.new/files/app/runtime.js:44:23)
    at webpackJsonpCallback(file:///data/data/org.nativescript.new/files/app/runtime.js:31:19)
    at (file:///data/data/org.nativescript.new/files/app/bundle.js:2:57)
    at require(:1:266)

Json

{
    "using_ios": true,
    "using_android": true,
    "analytics": false,
    "firestore": false,
    "realtimedb": true,
    "authentication": false,
    "remote_config": false,
    "performance_monitoring": false,
    "external_push_client_only": false,
    "messaging": true,
    "in_app_messaging": false,
    "crashlytics": false,
    "storage": false,
    "functions": false,
    "facebook_auth": false,
    "google_auth": false,
    "admob": false,
    "dynamic_links": false,
    "ml_kit": false
}

Package details:

{
  "nativescript": {
    "id": "org.nativescript.new",
    "tns-ios": {
      "version": "6.2.0"
    },
    "tns-android": {
      "version": "6.2.0"
    }
  },
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "repository": "<fill-your-repository-here>",
  "dependencies": {
    "@nativescript/theme": "~2.2.0",
    "nativescript-plugin-firebase": "^10.3.0",
    "tns-core-modules": "~6.2.0"
  },
  "devDependencies": {
    "nativescript-dev-webpack": "~1.3.0"
  },
  "gitHead": "a6fec076a20f898feabb4466a2c411158c18a100",
  "readme": "NativeScript Application"
}

I'm not sure what causes the issue, but I'd really appreciate it if you could help enlighten me on fixing it.

Looking forward to hearing from you

Most helpful comment

@manojdcoder I have added you to the repo.

All 21 comments

plz share a repo I can run so I can reeproduce it.

Thanks for your quick response, I've sent you an invitation, please let me know if you've received.
You can check it here as well: https://github.com/thecicada/test/invitations

Thank you again

OK, let's continue in your repo. I'll create a ticket.

Alright, thank you so much.

@EddyVerbruggen @thecicada May I ask for a solution? The mentioned repo was deleted...

@SamuelNitsche , Unfortunately, there was no solution. Did you find one?

@thecicada No, I didn't find one.

is there any solution yet ?

If you anyone have same issue still, please share a sample project where the issue can be reproduced.

@Cclown98 No solution was found on my end :(
@EddyVerbruggen did you still figure out anything in this regard? Thanks
@manojdcoder I have added you to the repo.

@manojdcoder I have added you to the repo.

@thecicada I checked out your repo and seeing the error below.

Execution failed for task ':app:processDebugGoogleServices'.
No matching client found for package name 'org.nativescript.amuse'

This happens when your app's package name doesn't match with your Firebase configuration. I updated your package name to com.amuseme. Also you had specified your compileSdkVersion to 28, it should be 29 if you want to use forceDarkAllowed attribute. After fixing this, I was able to run the app successfully.

@manojdcoder, Thank you for your time,
I did the above and still getting the same error,
Do you have Skype id, for a quick chat, please?

@thecicada Hello,

I am having the same issue atm ... Did you find out a solution?

Thank you!

@gogolplexus No solution was found on my end. I moved on with different environment.
Hopefully @@EddyVerbruggen will attend to this one day.

@gogolplexus You might reopen the case, so it moves a little bit, as I see more people are being stuck due to this issue.

@thecicada Please find my email on my Github profile to schedule a call.

@manojdcoder Sent you skype message.

@thecicada As discussed over Skype, it seems to be something wrong with your setup. None of the CLI hooks or NPM post install scripts running, due to which the required native libraries are not getting installed. I'm not sure how it could be fixed, I suggest you to search against NPM / Node issues see if you find anything.

Same issue as well

reinstalling (remove & add) the module seemed to solve my issue

Was this page helpful?
0 / 5 - 0 ratings