PhoneGap on Android does not load external scripts

I am making a simple application that will download a google map. but the problem is that every time I download this

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>

It will not work on my Android emulator, and on the desktop it works fine. How can I let Phonegap or Android allow external scripts to work / load?

UPDATE: I always get this error "Application error: the connection to the server was unsuccessful. (File /// android_asset / www / index.html). But if I remove the google script map, it will work.

+5
source share
3 answers

In fact, whitelisting is a problem similar to @TDeBailleul, but it referenced the whitelist location in iOS, not Android.

android /res/xml/PhoneGap.xml

: fooobar.com/questions/1103635/...

+2

PhoneGap (2.7.0). "config.xml", /res/ Android. :

<access origin="http://www.yourdomain.com" subdomains="true" />

, .

0

5.1 .

cordova-plugin-whitelist. plugins/cordova-plugin-whitelist/README.md, .

(, ), .

<!-- Enable all requests, inline styles, and eval() -->
<meta http-equiv="Content-Security-Policy" content="script-src: 'self' 'unsafe-inline' 'unsafe-eval' 'https://maps.google.com'">
0

All Articles