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.

System.err: TypeError: Cannot read property 'getInstance' of undefined

See original GitHub issue

Hello Guys, i’m getting the following error in Android. I don’t know what am doing wrong. Any help will be much appreciated. Thanks.

JS: Angular is running in the development mode. Call enableProdMode() to enable the production mode. System.err: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.amole.notify/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: System.err: Calling js method onCreate failed System.err: TypeError: Cannot read property 'getInstance' of undefined System.err: File: "file:///data/data/com.amole.notify/files/app/tns_modules/nativescript-plugin-firebase/firebase.js, line: 286, column: 69 System.err: StackTrace: System.err: Frame: function:'runInit', file:'file:///data/data/com.amole.notify/files/app/tns_modules/nativescript-plugin-firebase/firebase.js', line: 286, column: 70 System.err: Frame: function:'Observable.notify', file:'file:///data/data/com.amole.notify/files/app/tns_modules/tns-core-modules/data/observable/observable.js', line: 110, column: 23 System.err: Frame: function:'notifyLaunch', file:'file:///data/data/com.amole.notify/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 870, column: 17 System.err: Frame: function:'ActivityCallbacksImplementation.setActivityContent', file:'file:///data/data/com.amole.notify/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 803, column: 28 System.err: Frame: function:'ActivityCallbacksImplementation.onCreate', file:'file:///data/data/com.amole.notify/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 677, column: 14 System.err: Frame: function:'NativeScriptActivity.onCreate', file:'file:///data/data/com.amole.notify/files/app/tns_modules/tns-core-modules/ui/frame/activity.js', line: 20, column: 25

package.json "nativescript": { "id": "com.amole.notify", "tns-android": { "version": "4.1.3" } }, "scripts": { "lint": "tslint \"app/**/*.ts\"" }, "dependencies": { "@angular/animations": "~6.0.6", "@angular/common": "~6.0.6", "@angular/compiler": "~6.0.6", "@angular/core": "~6.0.6", "@angular/forms": "~6.0.6", "@angular/http": "~6.0.6", "@angular/platform-browser": "~6.0.6", "@angular/platform-browser-dynamic": "~6.0.6", "@angular/router": "~6.0.6", "nativescript-angular": "~6.0.6", "nativescript-plugin-firebase": "^6.4.1", "nativescript-theme-core": "~1.0.4", "nativescript-ui-sidedrawer": "~4.1.0", "reflect-metadata": "~0.1.10", "rxjs": "~6.1.0", "tns-core-modules": "4.1.1", "zone.js": "~0.8.18" },

app.gradle `android {
defaultConfig {
generatedDensities = [] applicationId = “com.amole.notify”
multiDexEnabled true }
aaptOptions {
additionalParameters “–no-version-vectors”
}
dexOptions { javaMaxHeapSize “4g” }

project.ext { googlePlayServicesVersion = “11.8.0” } }`

`buildscript {

repositories {
    google()
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.2'
    classpath 'com.google.gms:google-services:3.1.0'
}

}

allprojects { repositories { google() jcenter() } }

task clean(type: Delete) { delete rootProject.buildDir }`

main.ts | i also moved it to app.component.ts still had the same error. `import { platformNativeScriptDynamic } from “nativescript-angular/platform”;

import { AppModule } from “./app.module”; import * as Firebase from ‘nativescript-plugin-firebase’;

Firebase.init({}) .then((instance) => { console.log(‘firebase.init done’); }, (error) => { console.log(firebase.init error: ${error});

}); platformNativeScriptDynamic().bootstrapModule(AppModule);`

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
EddyVerbruggencommented, Aug 2, 2018

Ah, sidekick, makes sense. Would it help if I add a note about this in the readme, or would nobody read that anyway? 🤭

2reactions
ngoahamoscommented, Aug 2, 2018

It will be very helpful if you add a note about it in the readme.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'getInstance' of undefined #193 - GitHub
I'm getting this error when trying to use this package: Cannot read property 'getInstance' of undefined It happens in componentDidMount when ...
Read more >
Cannot read property 'getInstance' of undefined
When trying to authorize an org/ trying to deploying source to org / retrieve the source from an org i'm getting below error....
Read more >
Form throws the "Cannot read property 'getInstance' of ...
Form throws the "Cannot read property 'getInstance' of undefined" error if ButtonItem is defined in a group. Hi, I have seen several tickets ......
Read more >
Cannot Read Property of Undefined in JavaScript - Rollbar
TypeError: Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >
java.choose returns cannot read property of undefined
I have found that there is method named b(String str) of an app by using Jadx-gui now i am using follwing function to...
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