[Google Maps Mobile] Error Invalid call of the 'InitMap' client action of the 'xxx' since the latte...

Forge Component
(16)
Published on 2018-10-11 by Labs
16 votes
Published on 2018-10-11 by Labs

Firstly, we got the error ""undefined is not an object(evauating 'osGoogleMap.OSMaps')" on production, after that we tried to fix it on the development environment by updating GoogleMap plugin to the latest version and we got the error below instead. Any idea how to fix this issue?


ControllerDisposedException: Invalid call of the 'InitMap' client action of the 'MainFlow.Contact' since the latter is not currently active. This is likely due to a platform's client action being used as an event handler or in a setTimeout function. Consider removing this call by using the 'On Destroy' event of the screen/block or moving your logic to a global client action.
    at Controller.t.ensureControllerAlive (https://bopcl-dev.outsystemsenterprise.com/MatchLink/scripts/OutSystems.js?oPGXQmcWYrdRVt9OsgLnOQ:10:2197)
    at Controller._initMap$Action (https://bopcl-dev.outsystemsenterprise.com/MatchLink/scripts/GoogleMapsMobile.GoogleMaps.SingleLocationMap.mvc.js?syxx7V_tyGUMeQU5muYSdg:413:12)
    at Controller.e.executeActionInsideJSNode (https://bopcl-dev.outsystemsenterprise.com/MatchLink/scripts/OutSystems.js?oPGXQmcWYrdRVt9OsgLnOQ:9:26383)
    at Controller.t.executeActionInsideJSNode (https://bopcl-dev.outsystemsenterprise.com/MatchLink/scripts/OutSystems.js?oPGXQmcWYrdRVt9OsgLnOQ:10:1991)
    at Object.initMap$Action [as InitMap] (https://bopcl-dev.outsystemsenterprise.com/MatchLink/scripts/GoogleMapsMobile.GoogleMaps.SingleLocationMap.mvc.js?syxx7V_tyGUMeQU5muYSdg:298:19)
    at apiInitializeFinish (https://bopcl-dev.outsystemsenterprise.com/MatchLink/scripts/GoogleMapsMobile.GoogleMaps.SingleLocationMap.mvc.js?syxx7V_tyGUMeQU5muYSdg:1033:14)
    at Object.execCb (https://bopcl-dev.outsystemsenterprise.com/MatchLink/scripts/OutSystems.js?oPGXQmcWYrdRVt9OsgLnOQ:1:11818)
    at b.check (https://bopcl-dev.outsystemsenterprise.com/MatchLink/scripts/OutSystems.js?oPGXQmcWYrdRVt9OsgLnOQ:1:5974)
    at b.<anonymous> (https://bopcl-dev.outsystemsenterprise.com/MatchLink/scripts/OutSystems.js?oPGXQmcWYrdRVt9OsgLnOQ:1:8389)
    at https://bopcl-dev.outsystemsenterprise.com/MatchLink/scripts/OutSystems.js?oPGXQmcWYrdRVt9OsgLnOQ:1:641




-----------------------------------------------------------------------------------------------------------------

Here is the detail of what we try to fix this issue.



We got the error "undefined is not an object(evauating 'osGoogleMap.OSMaps')" from GoogleMap Plugin - https://www.outsystems.com/forge/component-overview/1396/google-maps-mobile randomly both on iOS an Andriod. 


Here is the step to reproduce in our MatchLink app.


1. Download "MatchLink" app from the store

2. Sign in with Facebook or Gmail or Sign up and Login with an email.

3. After signing in, go to the contact page by selecting it from user avatar icon.

4. It will open contact page which contains the google map. You can see the error at this time like in the picture below:


 


Here is the error detail, we found:

This issue occurs in the production environment.

-----------------------------------------------------------------------------------------------------

We tried to fix it in the development environment by updating the latest version of  Google Map Plugin.


The issue seems to be solved. However, we found another issue instead.

This time, the steps to reproduce the new issue are:

1. Open MatchLink app from the development environment

2. Sign in with Facebook or Gmail or Sign up and Login with an email.

3. After signing in, go to the contact page by selecting it from user avatar icon.

4. It will open contact page which contains the google map. This time, there is no error. 

5. However, if we click the navigate button which will open the Google Map app in order to use navigation feature of it and then click back to go back to MatchLink application.

 

6. The MatchLink application will crash and show error like the picture below:

Here is the error detail we found in development server:


the error stack trace:

ControllerDisposedException: Invalid call of the 'InitMap' client action of the 'MainFlow.Contact' since the latter is not currently active. This is likely due to a platform's client action being used as an event handler or in a setTimeout function. Consider removing this call by using the 'On Destroy' event of the screen/block or moving your logic to a global client action.
    at Controller.t.ensureControllerAlive (https://bopcl-dev.outsystemsenterprise.com/MatchLink/scripts/OutSystems.js?oPGXQmcWYrdRVt9OsgLnOQ:10:2197)
    at Controller._initMap$Action (https://bopcl-dev.outsystemsenterprise.com/MatchLink/scripts/GoogleMapsMobile.GoogleMaps.SingleLocationMap.mvc.js?syxx7V_tyGUMeQU5muYSdg:413:12)
    at Controller.e.executeActionInsideJSNode (https://bopcl-dev.outsystemsenterprise.com/MatchLink/scripts/OutSystems.js?oPGXQmcWYrdRVt9OsgLnOQ:9:26383)
    at Controller.t.executeActionInsideJSNode (https://bopcl-dev.outsystemsenterprise.com/MatchLink/scripts/OutSystems.js?oPGXQmcWYrdRVt9OsgLnOQ:10:1991)
    at Object.initMap$Action [as InitMap] (https://bopcl-dev.outsystemsenterprise.com/MatchLink/scripts/GoogleMapsMobile.GoogleMaps.SingleLocationMap.mvc.js?syxx7V_tyGUMeQU5muYSdg:298:19)
    at apiInitializeFinish (https://bopcl-dev.outsystemsenterprise.com/MatchLink/scripts/GoogleMapsMobile.GoogleMaps.SingleLocationMap.mvc.js?syxx7V_tyGUMeQU5muYSdg:1033:14)
    at Object.execCb (https://bopcl-dev.outsystemsenterprise.com/MatchLink/scripts/OutSystems.js?oPGXQmcWYrdRVt9OsgLnOQ:1:11818)
    at b.check (https://bopcl-dev.outsystemsenterprise.com/MatchLink/scripts/OutSystems.js?oPGXQmcWYrdRVt9OsgLnOQ:1:5974)
    at b.<anonymous> (https://bopcl-dev.outsystemsenterprise.com/MatchLink/scripts/OutSystems.js?oPGXQmcWYrdRVt9OsgLnOQ:1:8389)
    at https://bopcl-dev.outsystemsenterprise.com/MatchLink/scripts/OutSystems.js?oPGXQmcWYrdRVt9OsgLnOQ:1:641




Right now, we have no clue how to fix this. Do you have any idea?

Additional info. The error "Invalid call of the 'InitMap' client action of the 'xxx'" occurs only on iOS, not on Andriod.