繁体   English   中英

使用Android的Sencha Native Packaging

[英]Sencha Native Packaging with android

以下是我的配置文件(packager.json)

{
"applicationName":"Sencha",
"applicationId":"Sencha",
"iconName":"icon.png",
"versionString":"1.0",
"outputPath":"D:/wamp/www/sencha/mvc/",
"inputPath":"C:/wamp/www/sencha",
"webAppPath":"C:/wamp/www/sencha",
"androidAPILevel":"15",
"configuration":"Debug",
"platform":"AndroidEmulator",
"deviceType":"Universal",
"certificatePath":"debug.keystore",
"certificateAlias":"androiddebugkey",
"sdkPath":"C:\Program Files\Android\android-sdk",
"orientations": [
    "portrait",
    "landscapeLeft",
    "landscapeRight",
    "portraitUpsideDown"
]
}

我还为调试模式创建了证书。

以下是我用来生成证书文件的命令

keytool.exe -genkey -v -keystore debug.keystore -alias androiddebugkey -keyalg RSA -keysize 2048 -validity 10000

然后,

D:\wamp\www\sencha>sencha package run packager.json

命令没有给出错误。 假设此命令生成.apk文件,对吗? 但是什么都没发生?

是什么原因造成的?

似乎android-sdk路径中的反斜杠可能是造成此问题的原因。

"sdkPath":"C:\\Program Files\\Android\\android-sdk",更改为"sdkPath":"C:/Program Files/Android/android-sdk",

还可以尝试使用sencha package build <packager json filename>代替sencha package run <packager json filename>因为run命令期望运行的模拟器。

对我来说,它还需要“ certificatePassword”作为打包程序json文件中的条目之一。 如果还有其他并发症,请与我联系。

有相同的问题:

Sencha : Android Native Build - ERROR 17: Unable to load PKCS12 identity

为了构建Android Native应用,我引用了Sencha Doc(http://docs.sencha.com/touch/2-0/#!/...native_android)

    Step1:
    I created an Android Certificate using following command
    keytool -genkey -v -keystore athena.keystore -alias athena -keyalg RSA -keysize 2048 -validity 10000

    Step 2:
    Under Sencha-touch2-SDK directory, to build a apk file, I run following command:
    sencha app build native 

    with this I get following error: 
    ERROR 17: Unable to load PKCS12 identity from "/path/to/certificate.file"Failed to package application*



    Its not clear to me,
     if I need to user command jarsigner as follows:

    jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore athena.keystore athenamobile.apk athena

    ( when I tried above command, I get message: jarsigner: unable to open jar file: athenamobile.apk)


    Here is my android.json:        
    { 
    "applicationName":"AthenaMobile",
    "applicationId":"com.mycompany.AthenaMobile",
    "versionString":"1.0",
    "versionCode":"1",
    "iconName":"resources/icons/Icon~ipad.png",
    "inputPath":"C:/sencha-touch-2.0.1.1/AthenaMobile",
    "outputPath":"C:/sencha-touch-2.0.1.1/AthenaBuild",
    "configuration":"Release",
    "platform":"Android",
    "deviceType":"Universal",
    "certificatePath":"c:/athena.keystore",
    "certificatePassword":"athena", 
    "certificateAlias":"athena",
    "sdkPath":"c:/android-sdk-windows",
    "androidAPILevel":"16",
    "orientations": [
    "portrait",
    "landscapeLeft",
    "landscapeRight",
    "portraitUpsideDown"
    ]
    }


    Please note that,
    I did try command "sencha package run android.json" (as per doc),
    and hit with following errors:**

    Added file C:\sencha-touch-2.0.1.1\AthenaBuild\proguard-project.txt
    Buildfile: C:\sencha-touch-2.0.1.1\AthenaBuild\build.xml


    -set-mode-check:


    -set-release-mode:
    jarsigner: unable to open jar file: C:\sencha-touch-2.0.1.1\AthenaBuild\\
    enaMobile-release-unsigned.apk
    ""c:\android-sdk-windows\tools\android" create project --target android-1
    e AthenaMobile --activity STActivity --path "C:\sencha-touch-2.0.1.1\Athe
    \/" --package com.mycompany.AthenaMobile"
    Could not sign application with error: 1
    Failed to package application
    [ERROR]
    BUILD FAILED
    C:\android-sdk-windows\tools\ant\build.xml:1070: com.sun.org.apache.xerce
    nal.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-
    nce.
    at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidB
    8Reader.java:684)
    at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF

暂无
暂无

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

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