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

See original GitHub issue

Hello, I’m writing an app which launch other apps (games) from it - here’s my code:

        var app = navigator.startApp.set({
            "package": "com.ea.game.nfs14_row"
        });
        app.start(function(){
            console.log('Game started!');
        }, function(err){
            console.log('Game start failed! ', err);
        });

It’s activated on click event via button, but when I click I’m getting an error:

Uncaught TypeError: Cannot read property 'set' of undefined

Earlier, I was trying to use startApp without navigator but that raises me an error that startApp is not defined.

I’m using Intel XDK and I’ve added plugin via it’s window plugin tool by pasting github url - I think it is installed correctly.

Please help!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
marwanyousrycommented, Aug 31, 2016

@lampaa

i got an error : Uncaught ReferenceError: startApp is not defined.

and when i tried to install plugin in my phonegap project by this command cordova plugin add com.lampa.startapp Plugin “com.lampa.startapp” already installed on android.

0reactions
lampaacommented, Aug 31, 2016

No need to use a variable navigator.

document.addEventListener("deviceready", function() {

    startApp.extraFields(function(fields) { /* success */
        console.log(fields);
    }, function(fail) { /* fail */
        alert(fail);
    });

    var field = "extra_field";

    startApp.getExtra(field, function(value) {
        console.log(value);
    }, function(fail) { 
        alert(fail);
    });
}, false);

More I do not know how to help. If does not work, try another plugin.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'set' of undefined in javascript
I solved it by calling toObject() method of the fabric. Earlier I was using fabric 1.x and was going through a project revamp....
Read more >
Uncaught TypeError: Cannot read property of undefined In
Uncaught TypeError : Cannot read property of undefined error occurs in Chrome when you read a property or call a method on an...
Read more >
TypeError: Cannot read property 'set' of undefined #768 - GitHub
I compiled my Node.JS script and when I ran the executable it displayed this error: internal/modules/cjs/loader.js:1122 throw err; ...
Read more >
How to Prevent the Error: Cannot Read Property '0' of Undefined
The Cannot read property xxx of undefined error is one such example. In particular, the Cannot read property 'n' of undefined (where n...
Read more >
Cannot read property 'set' of undefined - Laracasts
I recently updated my laravel project from 5.2 to 5.3, I also updated Laravel Spark to 2.0 after that, I receive this error...
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