EddyVerbruggen / nativescript-directions

:point_up_2: :point_right: :point_down: :point_left: Open the Maps app to show directions to anywhere you like
MIT License
83 stars 21 forks source link

TypeError: Cannot read property 'startActivityForResult' of undefined #27

Closed pedmindset closed 5 years ago

pedmindset commented 5 years ago
TypeError: Cannot read property 'startActivityForResult' of undefined 

I get this error anytime i try to execute this code.. surprisingly it was working before @EddyVerbruggen help me out

           directions.navigate({
                to: this.nearByCustomers// array of coordinates,
                type: "driving",
                ios: {
                    preferGoogleMaps: true, 
                    allowGoogleMapsWeb: true 
                }
                }).then(() => {
                    console.log("Maps app launched.");
                }, error => {
                    console.log(error);
            });
Efrenray commented 5 years ago

also facing this problem

EddyVerbruggen commented 5 years ago

Do you guys perhaps run this code while the app is starting?

And what do you mean by "before"? A previous plugin version, or an older NativeScript version, or on your old Android device?

pedmindset commented 5 years ago

i removed the plugin and reinstalled, that made it work...

EddyVerbruggen commented 5 years ago

Make sure you're using 1.3.1, that probably helps.