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.

console.warn: Native: tried accessing the GoogleMaps plugin but Cordova is not available. Make sure to include cordova.js or run in a device/simulator

See original GitHub issue

That is the error appearing in the console, i run the project in my mobile phone so i dont understand why cordova is unavailable.

This is my code:

import { Component } from '@angular/core';
import { NavController, NavParams, Platform } from 'ionic-angular';
import {
    GoogleMaps,
    GoogleMap,
    GoogleMapsEvent,
    LatLng,
    CameraPosition,
    MarkerOptions,
    Marker
} from '@ionic-native/google-maps';

@Component({
    selector: 'page-map',
    templateUrl: 'map.html',
})



export class MapPage {
    latitud: any;
    longitud: any;
    map: GoogleMap;

    constructor(public navCtrl: NavController, public navParams: NavParams, private googleMaps: GoogleMaps, public platform: Platform) {
        this.latitud = "-38.007681";
        this.longitud = "-57.543674";
    }
    ionViewDidLoad() {
        this.loadMap();
    }

    loadMap() {
        let mapOptions = {
            camera: {
                target: {
                    lat: Number(this.latitud),
                    lng: Number(this.longitud)
                },
                zoom: 18,
                tilt: 30
            }
        };

        this.map = GoogleMaps.create('map', mapOptions);



        // listen to MAP_READY event
        // You must wait for this event to fire before adding something to the map or modifying it in anyway
        this.map.one(GoogleMapsEvent.MAP_READY).then(() => {
            console.log('Map is ready!');
   

        });

    }

}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:32 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
wf9a5m75commented, Mar 12, 2018

Yeah, very weird. I haven’t experienced this situation. But the problem is definitely ionic problem.

By the way, this presentation might help you use this plugin through @ionic-native/google-maps. https://docs.google.com/presentation/d/1zlkmoSY4AzDJc_P4IqWLnzct41IqHyzGkLeyhlAxMDE/edit#slide=id.p

0reactions
almaz1213commented, Dec 15, 2020

just solved. thanks guys,
wf9a5m75 Masashi Katsumata ndrake Nate Drake felipevencato Felipe Vencato for the helpful example. GOOD JOB!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tried accessing the GoogleMaps plugin but Cordova is not ...
util.js:63 Native: tried accessing the GoogleMaps plugin but Cordova is not available. Make sure to include cordova.js or run in a device/ ......
Read more >
Ionic 2: Cordova is not available. Make sure to include ...
First try to add browser by running below command ionic platform add browser and then run command ionic run browser . which is...
Read more >
cordova-plugin-geolocation
This plugin provides information about the device's location, such as latitude and longitude. Common sources of location information include Global Positioning ...
Read more >
cordova not available ionic 4
This happens when you try to call a native plugin, but Cordova isn't available. Thankfully, Ionic Native will print out a nice warning,...
Read more >
error: uncaught (in promise): cordova_not_available - You.com
Native : tried calling PluginName.prepare, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator.
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