我想获得一个基本的PhoneGap + jQuery Mobile的运行程序的Android 2.2平台,但我得到一个应用程序错误"到服务器的连接失败(文件:///android_asset/www/index.html)"中的当我尝试使用Eclipse 3.7在Windows XP上运行Android Emulator平台2.2中的应用程序时,Android Emulator .
如果我从HTML文件中删除了JQuery Mobile的所有引用和语法,那么文件会加载,所以我确信我的项目很好但是JQuery Mobile初始化时我缺少了一些东西.我使用的PhoneGap 0.9.6与jQuery Mobile的版本*1.0b1*与JQuery的版本1.6.1(我也试图与JQM版本1.0a2使用jQuery 1.4.4,但具有相同的错误).
如果我从我的HTML文件中删除对JQuery Mobile的所有引用,那么我可以在模拟器中加载程序而不会出现错误.
我在网上查看了几个示例并按原样尝试了它们,但所有这些示例都显示了相同的错误.我的文件如下:
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=320; user-scalable=no" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>PhoneGap With JQM</title>
<link rel="stylesheet" href="jquery.mobile-1.0b1.min.css" type="text/css" charset="utf-8" />
<script src="jquery-1.6.1.min.js"></script>
<script type="text/javascript" charset="utf-8" src="phonegap.0.9.6.js"></script>
<script type="text/javascript" charset="utf-8" src="main.js"></script>
<script src="jquery.mobile-1.0b1.min.js"></script>
</head>
<body onload="init();">
<div data-role="page" data-theme="e">
<div data-role="header">
<h1>PhoneGap with JQM</h1> …Run Code Online (Sandbox Code Playgroud) 我正在使用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
Run Code Online (Sandbox Code Playgroud)