Aditya Aditya - 2 months ago 20x
Android Question

External images not being displayed in Android app - Meteor - Cordova

I am developing an android app using Meteor and am having problems displaying images from external sources.

The following

tag should displays an image from the google maps api based on the latitude and longitude:

<img src="{{}},{{loc.lng}}&zoom=15&size=600x300&maptype=roadmap&markers=color:blue%7C{{}},{{loc.lng}}" />

Though this works in the browser, I get the below error on the server when trying to run it on an android device

XMLHttpRequest cannot load Origin http://meteor.local is not allowed by Access-Control-Allow-Origin.

Do I need to put the 'google maps api' domain in some kind of 'Whitelist' like when working with Phonegap.

If so, how do we do this in Meteor?


Yep, starting from 1.0.4, "Meteor Cordova apps no longer allow access to all domains by default."

So from now on, in your mobile-config.js file, you will have to call App.accessRule for every external domain you may load content from.

So in your case, adding:


at the end of your mobile-config.js file should do the trick.