Sencha app构建原生android包

时间:2013-03-01 10:56:08

标签: extjs sencha-touch sencha-touch-2

我已经制作了示例应用。我能够指南针编译。没有packager.json配置能够生成包。我需要android包,所以在packager.json中完成配置就像这样  的 “平台”: “机器人”, “sdkPath”:“D:/ Sench_Touch / android-sdk-windows”,但在命令提示符中给出错误,如下所示。如何解决这个问题?谁能告诉我。谢谢你

 [INF]           Completed compilation.
    [INF]           Processed remote file touch/sencha-touch.js
    [INF]           Processed local file app.js
    [INF]           Minified app.js
    [INF]           Minified resources/css/app.css
    [INF]           Generated app.json
    [INF]           Embedded microloader into index.html
    [INF]           Generating native package
    [INF]           Packaging your application as a native app to D:\Sench_Touch\sen
    cha-touch-2.1.1-gpl\DemoApp\build\DemoApp\native ...
    [ERR]           failed running native packager
    [ERR]           'xcopy' is not recognized as an internal or external command,
    operable program or batch file.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    Created directory D:\Sench_Touch\sencha-touch-2.1.1-gpl\DemoApp\build\DemoApp\na
    tive\src\com\mycompany\myAppID
    Added file D:\Sench_Touch\sencha-touch-2.1.1-gpl\DemoApp\build\DemoApp\native\sr
    c\com\mycompany\myAppID\STActivity.java
    Created directory D:\Sench_Touch\sencha-touch-2.1.1-gpl\DemoApp\build\DemoApp\na
    tive\res
    Created directory D:\Sench_Touch\sencha-touch-2.1.1-gpl\DemoApp\build\DemoApp\na
    tive\bin
    Created directory D:\Sench_Touch\sencha-touch-2.1.1-gpl\DemoApp\build\DemoApp\na
    tive\libs
    Created directory D:\Sench_Touch\sencha-touch-2.1.1-gpl\DemoApp\build\DemoApp\na
    tive\res\values
    Added file D:\Sench_Touch\sencha-touch-2.1.1-gpl\DemoApp\build\DemoApp\native\re
    s\values\strings.xml
    Created directory D:\Sench_Touch\sencha-touch-2.1.1-gpl\DemoApp\build\DemoApp\na
    tive\res\layout
    Added file D:\Sench_Touch\sencha-touch-2.1.1-gpl\DemoApp\build\DemoApp\native\re
    s\layout\main.xml
    Added file D:\Sench_Touch\sencha-touch-2.1.1-gpl\DemoApp\build\DemoApp\native\An
    droidManifest.xml
    Added file D:\Sench_Touch\sencha-touch-2.1.1-gpl\DemoApp\build\DemoApp\native\bu
    ild.xml
    Added file D:\Sench_Touch\sencha-touch-2.1.1-gpl\DemoApp\build\DemoApp\native\pr
    oguard-project.txt
    'C:\Users\User' is not recognized as an internal or external command,
    operable program or batch file.
    ""D:/Sench_Touch/android-sdk-windows\tools\android" create project --target andr
    oid-10 --name MyApplication --activity STActivity --path "D:\Sench_Touch\sencha-
    touch-2.1.1-gpl\DemoApp\build\DemoApp\native\/" --package com.mycompany.myAppID"

    Could not run ant with error: 1
    Failed to package application

2 个答案:

答案 0 :(得分:0)

您是否在具有空间名称的目录中安装了Sencha SDK工具?当我在Program Files中安装Sencha Cmd时,我遇到了同样的问题。我在这个问题之后将它安装在C:/ Sencha中并修复了。

答案 1 :(得分:0)

从你的app文件夹

运行

sencha cordova init

然后更改cordova.local.properties = android

保存。

运行 sencha app build native

如果你使用ST2.3.1,你会在 cordova \ platfomrs \ android \ ant-build * - *。apk 文件夹中找到app_name-debug.apk: - )

注意:'您需要使用 npm install cordova -g

安装cordova
相关问题