Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nativescript Firebase - “cannot read property of null” after upgrade to NS 3.4.0 on Android #3283

Closed
kmuthukrishnan opened this issue Dec 24, 2017 · 1 comment

Comments

@kmuthukrishnan
Copy link

Please, provide the details below:

Did you verify this is a real problem by searching [Stack Overflow]

YES

Tell us about the problem

My angular - Nativescript project uses the Nativescript-Firebase-Plugin. It works perfectly well in Nativescript 3.3.0 I upgraded my project to Nativescript 3.4.0. After upgrading the project, I am facing a major issue with all firebase queries on Android.

**JS: Error in firebase.query: TypeError: Cannot read property 'child' of null** JS: NO QUESTIONS FOR THIS USER JS: ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'length' of undefined JS: TypeError: Cannot read property 'length' of undefined JS: at file:///data/data/org.nativescript.qbank/files/app/feed/alphaCreate.component.js:55:23 JS: at SafeSubscriber.schedulerFn [as _next] (file:///data/data/org.nativescript.qbank/files/app/tns_modules/@angular/core/bundles/core.umd.js:3870:36) JS: at SafeSubscriber.__tryOrUnsub (file:///data/data/org.nativescript.qbank/files/app/tns_modules/rxjs/Subscriber.js:238:16) JS: at SafeSubscriber.next (file:///data/data/org.nativescript.qbank/files/app/tns_modules/rxjs/Subscriber.js:185:22) JS: at Subscriber._next (file:///data/data/org.nativescript.qbank/files/app/tns_modules/rxjs/Subscriber.js:125:26) JS: at Subscriber.next (file:///data/data/org.nativescript.qbank/files/app/tns_modules/rxjs/Subscriber.js:89:18) JS: at EventEmitter.Subject.next (file:///data/data/org.nativescript.qbank/files/app/tns_modules/rxjs/Subject.js:55:25) JS: at EventEmitter.emit (file:///data/data/org.nativescript.qbank/files/app/tns_modules/@angular/core/bundles/core.umd.js:3844:76) JS: at file:///data/data/org.nativescript.qbank/files/app/services/my-questions.service.js:51:42 JS: at ZoneDelegate.invoke (file:///data/data/org.nativescript.qbank/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:365:26) JS: at Object.onInvoke (file:///data/data/org.nativescript.qbank/files/app/tns_modules/@angular/core/bundles/core.umd.js:4156:37) JS: at ZoneDelegate.invoke (file:///data/data/org.nativescript.qbank/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:364:32) JS: at Zone.run (file:///data/data/org.nativescript.qbank/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:125:43) JS: at file:///data/data/org.nativescript.qbank/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:760:57 JS: at ZoneDelegate.invokeTask (file:///data/data/org.nativescript.qbank/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:398:31)

I tried to resolve it by
a. upgrading the native script firebase plugin: 5.0.5
b. upgrading all the dependenices of the project

But the issue is still occurring. This is a big blocker, and Please suggest what I can do to fix this.

Which platform(s) does your issue occur on?

Android

Please provide the following version numbers that your issue occurs with:

  • CLI: 3.4.0
  • Cross-platform modules: 3.4.0
  • Runtime(s): 3.4.0
  • Plugin(s):
    nativescript-firebase-plugin 5.0.5

Full package.json below:
{ "android": { "markingMode": "none" }, "description": "NativeScript Application", "license": "SEE LICENSE IN <your-license-filename>", "readme": "NativeScript Application", "repository": "<fill-your-repository-here>", "nativescript": { "id": "org.nativescript.qbank", "tns-ios": { "version": "3.4.0" }, "tns-android": { "version": "3.4.0" } }, "dependencies": { "@angular/animations": "~5.0.0", "@angular/common": "~5.0.0", "@angular/compiler": "~5.0.0", "@angular/core": "~5.0.0", "@angular/forms": "~5.0.0", "@angular/http": "~5.0.0", "@angular/platform-browser": "~5.0.0", "@angular/platform-browser-dynamic": "~5.0.0", "@angular/router": "~5.0.0", "nativescript-algolia": "0.0.4", "nativescript-angular": "~5.0.0", "nativescript-camera": "^3.1.4", "nativescript-email": "^1.5.1", "nativescript-fancyalert": "^1.1.2", "nativescript-filter-select": "^1.2.1", "nativescript-geolocation": "^3.0.0", "nativescript-gif": "^1.0.9", "nativescript-imagepicker": "^4.0.1", "nativescript-iqkeyboardmanager": "^1.1.0", "nativescript-loading-indicator": "^2.3.2", "nativescript-plugin-firebase": "^5.0.5", "nativescript-pro-ui": "^3.3.0", "nativescript-theme-core": "~1.0.4", "nativescript-toast": "^1.4.5", "nativescript-web-image-cache": "^4.2.2", "reflect-metadata": "~0.1.8", "rxjs": "^5.5.0", "tns-core-modules": "^3.4.0" }, "devDependencies": { "babel-traverse": "6.26.0", "babel-types": "6.26.0", "babylon": "6.18.0", "codelyzer": "~4.0.2", "es6-promise-loader": "^1.0.2", "lazy": "1.0.11", "nativescript-dev-typescript": "^0.6.0", "tslint": "^5.1.0", "typescript": "~2.4.2", "zone.js": "^0.8.4" } }

Please tell us how to recreate the issue in as much detail as possible.

tns run android and execute a firebase query

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

@NickIliev
Copy link
Contributor

Closing as duplicate to EddyVerbruggen/nativescript-plugin-firebase#585

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants