Application Error - The connection to the server was unsuccessful. (file:///android_asset/www/index.html)
Problem description:
The application developed by PhoneGap+Sencha Touch, the packaged APP or during debugging, the prompt is as follows at startup Information:
Application Error - The connection to the server was unsuccessful.
(file:///android_asset/www/index.html)
Problem analysis:
This should be a bug in some versions of PhoneGap, especially when index.html loads a lot of content comes out often.
Solution:
Method 1: Update to the latest version of PhoneGap;
Method 2: Set the loading timeout property
super.setIntegerProperty("loadUrlTimeoutValue",10000); The
complete code is as follows (set the timeout to 10 seconds)
@Override
publicvoid onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
super.loadUrl("file:///android_asset/www/home/index.html");
super.setIntegerProperty("loadUrlTimeoutValue",10000);
}
Method 3: Rename
method Rename index.html to main.html, and then create a new index.html page with the following content:
<!doctype html> <html> <head> < title>tittle</title> <script> window.location='./main.html'; </script> <body> </body> </html>
The main principle is to load the content of the home page through a transition page minimize.
Find config.xml in the res/xml directory of the project, and add the domain name address of your external network to the configuration
<access origin="http://example.com" /> <!--allow any secure requests to example .com -->
Method 4:
Copy the https reference in index.html to the local, directly from the local reference, not through http
<!--script src="https://cdn.rawgit.com/auth0/angular-storage/ master/dist/angular-storage.js"></script-->
<script src="
Application Error - The connection to the server was unsuccessful. (file:///and
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=326168367&siteId=291194637
Ranking