我安装了phonegap(v.3.5.0)并尝试使用Android 4.4.2在我的Nexus 7上运行默认的“Hello World”应用程序。它永远保留在“连接到设备”屏幕上。
使用Dalvik Debug Monitor时,我发现以下错误:
06-19 12:15:54.261: E/AndroidProtocolHandler(23049): Unable to open asset URL: file:///android_asset/www/phonegap.js
<script type="text/javascript" src="phonegap.js"></script>
是index.html文件中的一行。
答案 0 :(得分:1)
I was having the same issue: I followed the phonegap instructions to create a Hello World app, compiled for Android and iOS and just saw "Connecting to Device..." forever in both emulators.
I tried user3704578's proposed solution and manually copied phonegap.js into the {project}/www folder but this did not solve the problem.
What did solve the problem was switching from phonegap to cordova. Following the instructions in this document and starting over from scratch produced an app that worked in both platforms. Go figure!
答案 1 :(得分:0)
当我搞乱PhoneGap 3.1时,我碰到了类似的东西。当时我认为它与我的PhoneGap安装有关。解决方法是找到phonegap.js文件并手动将其复制到{project} / www文件夹中。
最终我切换到使用Cordova(使用cordova.js),除了编辑命令行界面(CLI)中的代码外,我做了所有事情。我使用Visual Studio或NotePad ++进行编辑。
您使用CLI进行构建,还是使用PhoneGap Build服务?我的预感是构建服务会自动为您插入,但我还没有尝试过,所以这只是猜测。