I have created Android + Cordova project for the purpose of creating and testing cordova plugin but when app opens it gives me the following error.Application Error Connection to server was unsuccessful (file:///android_asset/www/main.html)
MainActivity.java
public class MainActivity extends DroidGap {
@Override
public void onCreate(Bundle savedInstanceState) {
try {
super.onCreate(savedInstanceState);
super.setIntegerProperty("loadUrlTimeoutValue", 6000);
super.loadUrl("file:///android_asset/www/main.html");
}catch(Exception e){
e.printStackTrace();
}
} }
I have added Cordova jar in the lib folder and cordova.js and main.html file in assets/www folder. This error already present on StackOverflow but that doesn't solve my problem.