Cordova 5.0 cannot access the internet. Solution to 404 error

Source: Internet
Author: User

Problem:

Recently I changed my notebook and reconfigured the development environment. cordova upgraded to the latest 5.0, and found that the built application does not support access to the internet interface. Everything is normal for IOS, and error 404 is reported for all interfaces accessing the Internet for Android.

Solution:

Method 1: Add the white list plug-in cordova-plugin-whitelist, which is convenient and convenient,


Cordova plugin add cordova-plugin-whitelist

Method 2: Add security settings


<Meta http-equiv = "Content-Security-Policy" content = "default-src 'self 'https: // * .MYDOMAIN.com; style-src 'self ''' unsafe-inline'; script-src 'self ''' unsafe-inline''' unsafe-eval' ">

(No questions are found in the wall, let alone the answer. The novelty depends on google .)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.