Problem: my app runs cool in the emulator but when it generates the .apk it does not access the internet.
Note: I have not changed anything in config.xml and androidManifests.xml.
Problem: my app runs cool in the emulator but when it generates the .apk it does not access the internet.
Note: I have not changed anything in config.xml and androidManifests.xml.
Ezequiel, the PhoneGap in its own documentation has a detailed explanation of Internet access by the Application. Follow the link:
I recommend you read it, because it is of great help.
Run the following commands on your terminal in the directory of your application:
$ cordova plugin add cordova-plugin-whitelist
$ cordova prepare
(If it's windows, you do not need $)
And add the following line to your config.xml
:
<allow-navigation href="*" />
This line basically gives you permission to access all pages of the internet through your application.
NOTE: In your config.xml
, check to see if you have any other <allow-navigation>
tag, if you have it, you can delete it and copy the one I passed over.