EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 448 forks source link

Cannot read property 'sendCrashLog' of undefined #1757

Closed darkyelox closed 3 years ago

darkyelox commented 3 years ago

No matter how I import crashlytics in NS 7 it throws me this error every time I try to use crashlytics.sendCrashLog, I have tried using require and import.

I have enabled crashlyticsCollectionEnabled.

Platform: iOS 14.3 NativeScript versions:

my firebase.nativescript.json content:

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

and my package.json content:

{
  "name": "@nativescript/template-hello-world-ng",
  "main": "main.js",
  "version": "7.0.8",
  "author": "NativeScript Team <oss@nativescript.org>",
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "publishConfig": {
    "access": "public"
  },
  "keywords": [
    "nativescript",
    "mobile",
    "angular",
    "{N}",
    "template"
  ],
  "repository": "<fill-your-repository-here>",
  "bugs": {
    "url": "https://github.com/NativeScript/NativeScript/issues"
  },
  "dependencies": {
    "@angular/animations": "~11.0.0",
    "@angular/common": "~11.0.0",
    "@angular/compiler": "~11.0.0",
    "@angular/core": "~11.0.0",
    "@angular/forms": "~11.0.0",
    "@angular/platform-browser": "~11.0.0",
    "@angular/platform-browser-dynamic": "~11.0.0",
    "@angular/router": "~11.0.0",
    "@mabs.dk/nativescript-animejs": "^3.2.1-alpha.0",
    "@nativescript-community/ui-canvas": "4.0.35",
    "@nativescript-community/ui-pager": "^13.0.3",
    "@nativescript/angular": "~11.0.0",
    "@nativescript/auto-fit-text": "^1.0.0",
    "@nativescript/background-http": "^5.0.1",
    "@nativescript/core": "^7.0.13",
    "@nativescript/datetimepicker": "2.0.4",
    "@nativescript/firebase": "11.1.3",
    "@nativescript/iqkeyboardmanager": "^2.0.0",
    "@nativescript/localize": "5.0.2",
    "@nativescript/theme": "~3.0.0",
    "animejs": "^3.2.1",
    "base-64": "1.0.0",
    "class-transformer": "0.3.1",
    "clone-deep": "4.0.1",
    "humanize-duration": "3.24.0",
    "lodash.groupby": "4.6.0",
    "lodash.isnil": "4.0.0",
    "lodash.orderby": "4.6.0",
    "lodash.shuffle": "4.2.0",
    "lodash.values": "4.3.0",
    "moment": "2.29.1",
    "nativescript-email": "1.6.0",
    "nativescript-feedback": "2.0.0",
    "nativescript-gif": "^5.0.0",
    "nativescript-imagecropper": "4.0.1",
    "nativescript-mediafilepicker": "4.0.2",
    "nativescript-permissions": "1.3.11",
    "nativescript-phone": "2.0.0",
    "nativescript-rater": "2.1.2",
    "nativescript-sqlite": "^2.6.6",
    "nativescript-ui-listview": "9.0.4",
    "nativescript-ui-sidedrawer": "9.0.3",
    "ngx-custom-validators": "10.0.0",
    "ngx-moment": "5.0.0",
    "reflect-metadata": "~0.1.12",
    "rxjs": "^6.6.0",
    "typeorm": "0.2.24",
    "url": "^0.11.0",
    "zone.js": "~0.11.1"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~11.0.0",
    "@nativescript/android": "7.0.1",
    "@nativescript/ios": "7.0.6",
    "@nativescript/types": "7.0.4",
    "@nativescript/webpack": "3.0.8",
    "@ngtools/webpack": "11.0.2",
    "@types/node": "14.14.10",
    "sass": "1.29.0",
    "typescript": "4.0.5"
  },
  "gitHead": "41a7254d3bc134fd3c258761f3c6e1c3d54e6d41",
  "private": "true",
  "readme": "NativeScript Application"
}
AgustinV08 commented 3 years ago

@darkyelox Are you importing crashlytics like this?

import { crashlytics } from "@nativescript/firebase/crashlytics";

darkyelox commented 3 years ago

Sorry for very late response, that fixes it