[Solved] Cannot read property 'BaseArrayClass' of null

Hello,
hello,
i trying to set a googlemaps in my app following this documentation https://ionicframework.com/docs/native/google-maps/ ,
but when i run the app i have this error:


ERROR TypeError: Cannot read property 'BaseArrayClass' of null
    at new BaseArrayClass (index.js:621)
    at GoogleMaps.create (index.js:371)
    at HomePage.webpackJsonp.195.HomePage.loadMap (home.ts:39)
    at HomePage.webpackJsonp.195.HomePage.ionViewDidLoad (home.ts:22)
    at ViewController._lifecycle (view-controller.js:566)
    at ViewController._didLoad (view-controller.js:439)
    at Tab.NavControllerBase._didLoad (nav-controller-base.js:950)
    at t.invoke (polyfills.js:3)
    at Object.onInvoke (core.es5.js:3890)
    at t.invoke (polyfills.js:3)

how i can fix it?
Thanks :slight_smile:

Wow, this is happening to me too!

I’m going to blindly speculate that y’all are attempting to interact with Cordova stuff before Platform.ready() has resolved.

Same here
It would be helpful if code were tested before documenting.
This is the ongoing saga of ionic.

Mine works, and I started on the same page. If you google “Josh Morony ionic google map”, or something like it, he has a blog post from some time pretty recent that makes as a great follow up (avoid adding ‘backgroundColor’: ‘white’)

Also, the script that imports the google SDK (ends with initMap) benefits from having async defer added to it. That tripped me up for a good while.

thanks i solved with this video tutorial :smiley:

Awesome! Glad it worked out for you @nadako.

I have the same problem in my application. I don’t know if this is the best shape but for me resolve for now. (sorry, my english is not very good rsrs).

So try change this:

this.googleMaps.create(this.mapElement, mapOptions);

For this:

this.map = new GoogleMap(this.mapElement, mapOptions);

Thanks @cvalencia ! This worked for me.