2012-06-11 133 views
0

我想安装sencha touch 2.0项目到Android模拟器使用Phonegap(科尔多瓦)。日食科尔多瓦电话/ Android

我遵循教程中提到的步骤,并尝试HelloWorld示例,它的工作原理!

我把我的项目www目录资产产生的文件夹下,科尔多瓦jar文件,XML文件夹也加入

在主类,我做了以下内容: super.loadUrl("file:///android_asset/www/index.html");

但运行的应用程序后,它在控制台中显示以下内容:

[2012-06-11 15:48:27 - PhoneGap] Uploading PhoneGap.apk onto device 'emulator-5554' 
[2012-06-11 15:36:13 - PhoneGap] Uploading PhoneGap.apk onto device 'emulator-5554' 
[2012-06-11 15:38:10 - PhoneGap] Installing PhoneGap.apk... 
[2012-06-11 15:38:12 - PhoneGap] Installation failed due to invalid APK file! 
[2012-06-11 15:38:12 - PhoneGap] Please check logcat output for more details. 
[2012-06-11 15:38:13 - PhoneGap] Launch canceled! 

的logcat的:

06-11 13:00:27.003: DEBUG/SntpClient(65): request time failed: java.net.SocketException: Address family not supported by protocol 
06-11 13:04:24.309: DEBUG/dalvikvm(141): GC_EXPLICIT freed 1K, 12% free 14374K/16327K, paused 11ms+5ms 
06-11 13:05:27.041: DEBUG/SntpClient(65): request time failed: java.net.SocketException: Address family not supported by protocol 
06-11 13:06:05.003: INFO/installd(34): free_cache(6710880) avail 4059136 
06-11 13:06:05.009: ERROR/installd(34): cannot open /data/secure/data/: No such file or directory 
06-11 13:06:05.341: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.349: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.349: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.370: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.370: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.370: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.370: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.401: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.431: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.431: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.453: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.453: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.453: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.453: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.459: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.459: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.459: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.459: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.459: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.459: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.459: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.459: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.459: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.459: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.459: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.473: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.479: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.479: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.479: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.479: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.479: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.479: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.479: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.502: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.519: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.519: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.519: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.519: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.519: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.519: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.519: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.519: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.519: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.529: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.529: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.529: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.529: ERROR/installd(34): Couldn't openat cache: No such file or directory 
06-11 13:06:05.539: WARN/PackageManager(65): Couldn't clear application caches 
06-11 13:06:05.539: INFO/DeviceStorageMonitorService(65): Running low on memory. Sending notification 
06-11 13:06:05.871: DEBUG/Tablet/NotificationPanel(266): notificationCount=1 
06-11 13:06:06.123: INFO/dalvikvm(266): Jit: resizing JitTable from 512 to 1024 
06-11 13:06:06.209: WARN/ActivityManager(65): Unable to start service Intent { act=com.android.email.intent.action.MAIL_SERVICE_CANCEL cmp=com.android.email/.service.MailService }: not found 
06-11 13:06:12.769: DEBUG/dalvikvm(286): GC_EXPLICIT freed 67K, 9% free 6420K/6983K, paused 4ms+10ms 

我是否必须更新我的index.html文件以包含cordova.js文件?

+1

'请检查logcat的输出,以details.' – Rajesh

+1

地狱啊......包括在你的index.html –

+0

我把它的cordova.js文件,同样的问题 Developer

回答

0

如果您使用eclipse创建原生android应用程序,那么它真的很简单,可以在您的android模拟器中运行sencha应用程序。

我可以向你展示一些简单的操作步骤。

1)我建议你使用MDS鼓掌电话差距http://wiki.phonegap.com/w/page/34483744/PhoneGap%20Eclipse%20PlugIn%20for%20Android来安装phonegap。

2)只要你完成安装,你会看到顶部的电话差距图标。

3)然后点击它创建一个最小的手机差距项目。

4)你会看到没有必要的东西索引文件。 ü可以替代索引文件。如果你想使用手机的差距特点u可包括phonegap.js also.then在资产文件夹U可以创造必要建立一个煎茶应用程序文件夹下面

<!DOCTYPE html> 
    <html> 
    <head> 
    <title>The Sencha Touch List Component</title> 
    <link rel="stylesheet" href="app.css" type="text/css"> 

    <script type="text/javascript" src="touch/sencha-touch-all.js"></script> 
    <script type="text/javascript" charset="utf-8"> 
    Ext.Loader.setConfig({ 
    enabled: true, 
    paths: { 'Ext': 'touch/src' } 
    }); 
    </script> 
<script type="text/javascript" src="app.js"></script> 
    </head> 
    <body></body> 
    </html> 

5)。像应用程序文件夹,样式文件夹,触摸文件夹和其他必要的东西,如css文件和应用程序在www文件夹内。

6)只需在eclipse中浏览web浏览器中的index.html文件,就可以检查配置是否正确。

7)如果它确定,那么你可以在你的android模拟器中运行应用程序,就像你为你的本地应用程序一样。