1. #1
    Sencha User
    Join Date
    Jul 2009
    Posts
    6
    Vote Rating
    0
    kiyud is on a distinguished road

      0  

    Default How to create/ generate apk for Sencha Touch 2.0

    How to create/ generate apk for Sencha Touch 2.0


    Dear Gentlemen,

    I am a newbie. Is there any documentation which explain by example (step by step) to create apk for Sencha Touch 2.0 kitchen sink. Appreciated you response and thanks.

    Regards,
    Kiyud

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,408
    Vote Rating
    850
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      1  
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Jul 2009
    Posts
    6
    Vote Rating
    0
    kiyud is on a distinguished road

      0  

    Default


    Dear Mitchell,

    When I tried to run from DOS prompt "sencha package", finally got the following error:

    C:\Program Files\SenchaSDKTools-2.0.0-Beta\command>sencha package configForms.json
    ""C:\Program Files\SenchaSDKTools-2.0.0-Beta\tools\android" create project --target android-8 --name
    MyForm --activity STActivity --path C:\\ --package com.sencha.myForm"
    Failed to create android project
    Failed to package application

    C:\Program Files\SenchaSDKTools-2.0.0-Beta\command>

    Here is the template file:

    {
    "applicationName":"My Form",
    "applicationId":"com.sencha.myForm",
    "versionString":"1.0",
    "iconName":"C:\\xampp\\htdocs\\sencha-test\\icon.png",
    "inputPath":"C:\\xampp\\htdocs\\sencha-test",
    "outputPath":"C:\\",
    "configuration":"Release",
    "platform":"Android",
    "deviceType":"Universal",
    "certificatePath":"C:\\xampp\\htdocs\\sencha-test\\certForms.keystore",
    "certificateAlias":"certForms",
    "sdkPath":"C:\\Program Files\\SenchaSDKTools-2.0.0-Beta",
    "androidAPILevel":"8",
    "orientations": [
    "portrait",
    "landscapeLeft",
    "landscapeRight",
    "portraitUpsideDown"
    ]
    }

    FYI: I am using MS Windows XP SP3 and xampp web server
    I just don't get any idea how to fix it. Could you please advise ?
    Thanks.

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,408
    Vote Rating
    850
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    If you started the app off or upgraded the app to use sencha command then you should be in the app directory and use sencha app build native
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  5. #5
    Sencha User
    Join Date
    Jul 2009
    Posts
    6
    Vote Rating
    0
    kiyud is on a distinguished road

      0  

    Default


    I have already in the app folder:
    C:\xampp\htdocs\sencha-touch\examples\forms>

    I run sencha app build native as you suggested and got these messages:
    C:\xampp\htdocs\sencha-touch\examples\forms>sencha app build native
    C:\xampp\htdocs\sencha-touch\command\sencha.js:18 ReferenceError: require
    is not defined
    Execution error in C:\xampp\htdocs\sencha-touch\command\sencha.js.

    C:\xampp\htdocs\sencha-touch\examples\forms>

    Could you please help to show me an easy examples for this ? Thanks.

  6. #6
    Sencha User
    Join Date
    Apr 2012
    Posts
    4
    Vote Rating
    0
    tobiko is on a distinguished road

      0  

    Default


    Dont know if already solved by yourself, but you made a mistake in your package.json

    "sdkPath":"C:\\Program Files\\SenchaSDKTools-2.0.0-Beta",
    The path to your Android SDK is needet, not the Sencha SDK.

  7. #7
    Sencha User
    Join Date
    Jul 2009
    Posts
    6
    Vote Rating
    0
    kiyud is on a distinguished road

      0  

    Default




    I can finally build the apk under "androidAPILevel":"8".
    But I got an error message when tried to install on samsung galaxy mini froyo 2.2.

    Error : "Parse Error : There is a problem parsing the package"


    Could you please help ? Thanks.

  8. #8
    Sencha User
    Join Date
    Jul 2012
    Location
    India
    Posts
    1
    Vote Rating
    0
    rrss_1005 is on a distinguished road

      0  

    Default Get success in making .APK file but it not upload in android market duet to certi err

    Get success in making .APK file but it not upload in android market duet to certi err


    Dear,

    Get success in making .APK file but it not upload in android market due to certification error.
    I have already ask this question on forum but not get any answer form SENCHA side
    http://www.sencha.com/forum/showthread.php?229537-How-to-make-a-signed-APK-in-Sencha-Tuch-2
    t
    his is the detail description of problem.
    If any one able to solve this problem please let me know about it.

  9. #9
    Sencha User
    Join Date
    Feb 2012
    Location
    Detroit, MI
    Posts
    15
    Vote Rating
    0
    Nares is on a distinguished road

      0  

    Default


    Hi,
    This is my 1st time to build native app. So close ... Please help me if you manage to create APK file

    I'm trying to build Android native (sench package run android.json) and getting following error:

    Basically it try to open a jar file from a bin folderwith there are two \\ (highlighted in red colored).
    not sure if jar file were created during build process.


    - jarsigner: unable to open jar file: C:\release\\bin\AthenaMobile-release-unsigned.apk


    Here is my android.json (config file):
    {
    "applicationName":"AthenaMobile",
    "applicationId":"com.mycompany.AthenaMobile",
    "versionString":"1.0",
    "versionCode":"1",
    "iconName":"icon.png",
    "inputPath":"C:\\AthenaMobile",
    "outputPath":"C:\\release",
    "configuration":"Release",
    "platform":"Android",
    "deviceType":"Universal",
    "certificatePath":"C:\\athena.keystore",
    "certificatePassword":"athena",
    "certificateAlias":"athena",
    "sdkPath":"C:\\android-sdk-windows",
    "androidAPILevel":"15",
    "orientations": [
    "portrait",
    "landscapeLeft",
    "landscapeRight",
    "portraitUpsideDown"
    ]
    }



    Errors :
    C:\AthenaMobile>sencha package run android.json
    [INFO] JSON format error, please verify syntax


    C:\AthenaMobile>sencha package run android.json
    [INFO] Created directory C:\release\src\com\mycompany\AthenaMobile
    Added file C:\release\src\com\mycompany\AthenaMobile\STActivity.java
    Created directory C:\release\res
    Created directory C:\release\bin
    Created directory C:\release\libs
    Created directory C:\release\res\values
    Added file C:\release\res\values\strings.xml
    Created directory C:\release\res\layout
    Added file C:\release\res\layout\main.xml
    Created directory C:\release\res\drawable-hdpi
    Created directory C:\release\res\drawable-mdpi
    Created directory C:\release\res\drawable-ldpi
    Added file C:\release\AndroidManifest.xml
    Added file C:\release\build.xml
    Added file C:\release\proguard.cfg
    Buildfile: C:\release\build.xml


    -set-mode-check:


    -set-release-mode:
    jarsigner: unable to open jar file: C:\release\\bin\AthenaMobile-release-unsigne
    d.apk
    ""C:\android-sdk-windows\tools\android" create project --target android-15 --nam
    e AthenaMobile --activity STActivity --path "C:\release\/" --package com.mycompa
    ny.AthenaMobile"
    Could not sign application with error: 1
    Failed to package application
    [ERROR]
    BUILD FAILED
    C:\android-sdk-windows\tools\ant\build.xml:950: com.sun.org.apache.xerces.intern
    al.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequen
    ce.
    at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF
    8Reader.java:684)
    at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader
    .java:554)
    at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEnti
    tyScanner.java:1742)
    at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.skipSpaces(X
    MLEntityScanner.java:1492)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$Traili
    ngMiscDriver.next(XMLDocumentScannerImpl.java:1400)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(X
    MLDocumentScannerImpl.java:648)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next
    (XMLNSDocumentScannerImpl.java:140)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
    l.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
    ML11Configuration.java:808)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
    ML11Configuration.java:737)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.
    java:119)
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.
    java:235)
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Doc
    umentBuilderImpl.java:284)
    at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.j
    ava:468)
    at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.j
    ava:515)
    at com.android.ant.XPathTask.execute(XPathTask.java:78)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
    a:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:390)
    at org.apache.tools.ant.Target.performTasks(Target.java:411)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
    cutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
    at org.apache.tools.ant.Main.runBuild(Main.java:809)
    at org.apache.tools.ant.Main.startAnt(Main.java:217)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
    --------------- linked to ------------------
    javax.xml.xpath.XPathExpressionException
    at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.j
    ava:475)
    at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.j
    ava:515)
    at com.android.ant.XPathTask.execute(XPathTask.java:78)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
    a:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:390)
    at org.apache.tools.ant.Target.performTasks(Target.java:411)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
    cutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
    at org.apache.tools.ant.Main.runBuild(Main.java:809)
    at org.apache.tools.ant.Main.startAnt(Main.java:217)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
    Caused by: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceExcep
    tion: Invalid byte 1 of 1-byte UTF-8 sequence.
    at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF
    8Reader.java:684)
    at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader
    .java:554)
    at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEnti
    tyScanner.java:1742)
    at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.skipSpaces(X
    MLEntityScanner.java:1492)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$Traili
    ngMiscDriver.next(XMLDocumentScannerImpl.java:1400)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(X
    MLDocumentScannerImpl.java:648)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next
    (XMLNSDocumentScannerImpl.java:140)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
    l.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
    ML11Configuration.java:808)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
    ML11Configuration.java:737)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.
    java:119)
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.
    java:235)
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Doc
    umentBuilderImpl.java:284)
    at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.j
    ava:468)
    ... 18 more


    Total time: 0 seconds

  10. #10
    Sencha User
    Join Date
    Feb 2012
    Location
    Detroit, MI
    Posts
    15
    Vote Rating
    0
    Nares is on a distinguished road

      0  

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

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


    Hi Mike,

    To build an Android Native app, I followed 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



    Please help, been on this issue for long time
    Thanks in advance....