简体   繁体   English

Phonegap 3.5.0 + Android 4.4.2-卡在“正在连接到设备”屏幕上

[英]Phonegap 3.5.0 + Android 4.4.2 — stuck on “Connecting to Device” screen

I installed phonegap (v. 3.5.0) and tried running the default "Hello World" app on my Nexus 7 with Android 4.4.2. 我安装了phonegap(3.5.0版),并尝试在具有Android 4.4.2的Nexus 7上运行默认的“ Hello World”应用程序。 It stays on the "Connecting to Device" screen forever. 它永远停留在“正在连接设备”屏幕上。

When using the Dalvik Debug Monitor, I found the following error: 使用Dalvik调试监视器时,发现以下错误:

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> is a line in the index.html file by default. <script type="text/javascript" src="phonegap.js"></script>默认是index.html文件中的一行。

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. 我遇到了同样的问题:我按照phonegap的说明创建了一个Hello World应用程序,该应用程序针对Android和iOS进行了编译,并且在这两个模拟器中都永远看到“ Connecting to Device ...”。

I tried user3704578's proposed solution and manually copied phonegap.js into the {project}/www folder but this did not solve the problem. 我尝试了user3704578提出的解决方案,然后将phonegap.js手动复制到{project} / www文件夹中,但这不能解决问题。

What did solve the problem was switching from phonegap to cordova. 有什么解决问题,从PhoneGap的切换到科尔多瓦。 Following the instructions in this document and starting over from scratch produced an app that worked in both platforms. 遵循本文档中的说明并从头开始制作了一个可以在两个平台上都可以使用的应用程序。 Go figure! 去搞清楚!

I ran into something similar when I was messing with PhoneGap 3.1. 在弄乱PhoneGap 3.1时遇到了类似的情况。 At the time I thought it had something to do with my PhoneGap installation. 当时我认为这与我的PhoneGap安装有关。 The workaround was to find the phonegap.js file and manually copy it into {project}/www folder. 解决方法是找到phonegap.js文件,然后将其手动复制到{project} / www文件夹中。

Eventually I switched to using Cordova (which utilizes cordova.js) and I do everything but editing the code from the Command Line Interface (CLI). 最终,我转而使用Cordova(利用cordova.js),除了从命令行界面(CLI)编辑代码外,我什么都做。 I'm using Visual Studio or NotePad++ for editing. 我正在使用Visual Studio或NotePad ++进行编辑。

Are you using the CLI to do your build, or are you using the PhoneGap Build service? 您是使用CLI进行构建还是使用PhoneGap Build服务? My hunch is the Build service would insert it for you automatically, but I haven't tried it so that's just a guess. 我的直觉是Build服务会自动为您插入它,但是我没有尝试过,所以这只是一个猜测。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM