在Android模拟器上启动phonegap应用程序时出现“与服务器的连接未成功”错误

| 我正在使用PhoneGap构建一个Android应用程序,该应用程序是 phonegap + jquery mobile。 该应用程序已在模拟器中成功启动,并且我能够调试该应用程序,直到昨天。 今天,该应用程序只是拒绝在模拟器上启动,而我一直收到此错误
06-25 09:03:24.453: INFO/System.out(305): onReceivedError: Error code=-6 Description=The connection to the server was unsuccessful. URL=file:///android_asset/www/index.html
    
已邀请:
        这似乎是phonegap 0.9.3问题,因为其他人也报告了相同的问题(请参见此处或此处) 通过更改loadUrlTimeoutValue可以解决该问题
this.setIntegerProperty(\"loadUrlTimeoutValue\", 70000);
    
        使用较大的值然后60秒,模拟器可能会非常慢。 super.setIntegerProperty(\“ loadUrlTimeoutValue \”,360000); 您也可以参考这个。 检查一下!     
        我已经通过添加解决了这个问题
super.setIntegerProperty(\"loadUrlTimeoutValue\", 10000);  
到com.mypackage.xxx.java文件10秒钟的等待时间。即,
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    super.loadUrl(\"file:///android_asset/www/home/index.html\");
    super.setIntegerProperty(\"loadUrlTimeoutValue\", 10000); 
    

要回复问题请先登录注册