Differences in compilations


#1

I’ve been having a lot of problems lately with the different ways you can build apps.

I have 2 apps - 1 has a map feature using leaflet, and another app using a bunch of jsonp requests.

ionic serve - seems to work the best - no real issues and I can view console logs.

ionic upload - once on Ionic View, my app will only partially work.
for instance, my map feature app, and when pinch zooming, it freezes the map.
And for my jsonp request app, in Ionic View, I get no response on one of the calls (it works on 2 previous jsonp requests though), whereas when using ionic serve, it works fine.

ionic build android - This seems to have the most issues.
For my app that has the map feature - the map doesn’t even load.
For my app that has the jsonp requests - I can’t even get passed the first request.

Its enough to drive a person off a cliff :frowning:

Any help in these issues would be greatly appreciated.

Thanks!
Mike


#2

Can you post a snippet of your console and the errors (if any) that you’re seeing when trying to load the map on Android?

Without anything else to go, my best guess is you need to set the security permissions properly for Android.

Try placing this in the head in index.html:

<meta http-equiv="Content-Security-Policy" content="default-src *; script-src 'self' 'unsafe-inline' 'unsafe-eval' *; style-src 'self' 'unsafe-inline' *">
Then in your config.xml add:
<access origin="*"/> <allow-navigation href="*"/> <allow-intent href="*"/>


#3

Thanks!

That did work. Although now I’m getting “Unfortunately, has stopped” shortly after starting the app. Even though the map is shown.

I also ended up adding cordova-plugin-whitelist