talha06
talha06

Reputation: 6466

Sencha Touch 2 - Android Packaging errors

I'm trying to package my Sencha Touch 2 based mobile application for Android. Followed the steps mentioned at the Sencha documentation, always getting some different errors.

None of these commands works: (added errors below of each command)

$ sencha package build packager.json
[ERR] Command must be run from a package folder
$ sencha package run packager.json
[ERR] Unknown command: "run"
$ sencha package packager.json
[ERR] Unknown command: "packager.json"

After I googled this situation; found an answer that says valid command is:

$ sencha app package build packager.json

Getting these errors:

Copy operation failed src=st-res/android//nimblekit.jar dst=build///libs/nimblekit.jar
Can not open source file
Failed to copy packager library
Failed to package application

Environment & Tool Details:

OS : Linux

Sencha Touch version : 2.2.1

Sencha Cmd version : 3.1.2.342

Upvotes: 1

Views: 1986

Answers (2)

user1936277
user1936277

Reputation: 19

Sencha.cfg is created by Sencha Cmd, so:

did you generate the app by Sencha Cmd: sencha generate app? If not rename your app folder. Create the app with Sencha Cmd and copyright the content from the renamed folder to the created folder. Then try again.

Upvotes: 0

Rahul Dange
Rahul Dange

Reputation: 131

Following are steps to create Sencha android build:

  1. Create certificate using keytool command for signing android application:

    keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000

    it will create keystore for you.

  2. Open 'packager.json' file & make following changes:

    • Give application id like bundle id eg: 'com.abcd.appname'
    • change platform to 'Android' or 'AndroidEmulator'
    • then give certification path: i.e. path to your newly created keystore.
    • give your 'certificate alias' & 'certificate password'.
    • give your android 'sdkPath'
    • Also set 'androidAPILevel'. To find list of android api levels or targets, goto sdk-path/tools and hit ./android list target command
  3. Copy 'st-res' folder from your sencha cmd directory(for linux: /home/bin/Sencha/Cmd/ur-version-name/stbuild) to your project directory.

  4. then run command:

    sencha app build native

  5. It will create .apk file to output folder which you have set in 'packager.json' file.

Hope this will help you. But my opinion is you use Phonegap for packaging the app. You can build app using Sencha touch & just use Phonegap to deploy app to android or iOS.

Upvotes: 2

Related Questions