PDA

View Full Version : Sencha create should inform which field is missng



RuiPires
23 Feb 2012, 10:50 AM
missng should read missing

I am trying to package a native android app on windows, using the just released SDK tools.

I followed the guide at http://docs.sencha.com/touch/2-0/#!/guide/native_android

I (http://docs.sencha.com/touch/2-0/#!/guide/native_android) generated a config skeleton using
sencha package create test.json

After editing it looks like this (sniped the comments for brevity):


{
"applicationName":"VOLive",
"applicationId":"com.digisource.volive",
"iconName":"vo_icon_128:128.png",
"versionString":"1.0",
"outputPath":"c:/wamp/www/volive/build",
"webAppPath":"c:/wamp/www/volive/",
"configuration":"Debug",
"platform":"Android",
"deviceType":"Universal",
"certificatePath":"c:/wamp/www/test.keystore",
"certificateAlias":"androidtestkey",
"sdkPath":"c:/Program Files/Android/android-sdk",
"orientations": [
"portrait",
"landscapeLeft",
"landscapeRight",
"portraitUpsideDown"
]
}



When i try to package using
sencha package test.json

The output is:


c:\wamp\www\volive>sencha package test.json
Required field is missing from config file
Failed to package application



This error message is not as helpful as it should be IMO.

Other than that, any pointers where I could be doing something wrong?


Rui Pires

mitchellsimoens
23 Feb 2012, 11:02 AM
The tutorial doesn't mention the use of sencha package create command.

juanhernandezgomez
27 Feb 2012, 3:53 AM
I'm using Sencha Command (SDK Tools) v2.0.0 Beta on Windows and having the same issue.

I generated a config.json file with

sencha package generate config.json

Then updated the file with the specifics of my app.

{
"applicationName":"Presidents",
"applicationId":"com.bearingpoint.presidents",
"versionString":"1.0",
"iconName:":"icon.png",
"inputPath":"/Sencha/Presidents/web/",
"outputPath":"build/",
"configuration":"Debug",
"platform":"Android",
"deviceType":"Universal",
"certificatePath":"/Sencha/Presidents/res/native/Presidents.keystore",
"certificateAlias":"Presidents",
"sdkPath":"/Opt/Android/SDK/android-sdk-windows",
"orientations": [
"portrait",
"landscapeLeft",
"landscapeRight",
"portraitUpsideDown"
]
}


When running the package command I get an error that a field is missing but it doesn't mention which field is. The tool should be more verbose (or provide a parameter to be more verbose) and report which field is missing or if the value is incorrect.


Required field is missing from config file
Failed to package application


I've added and removed fields from the config file trying to identify which field was missing but the tool doesn't seem too robust about error reporting.
Sometimes I get this other error:

Required parameter is missing from config file

If I introduce an invalid value in the platform (eg. Android2) the tools runs with no output at all!!

It'd be nice if the tool gave more info about errors.

Has anyone else have had this issue and manage to package the app in the end?
Please provide details. Thanks

RuiPires
28 Feb 2012, 8:42 AM
Juan, sorry for my late reply but I have been busy with other unrelated projects.


{ "applicationName":"VOLive",
"applicationId":"com.digisource.volive",
"iconName":"vo_icon_128_128.png",
"versionString":"1.0",
"outputPath":"c:/wamp/www/volive/build",
"inputPath":"c:/wamp/www/volive/",
"configuration":"Debug",
"platform":"Android",
"deviceType":"Universal",
"certificatePath":"c:/wamp/www/test.keystore",
"certificateAlias":"androidtestkey",
"sdkPath":"c:/Program Files/Android/android-sdk",
"orientations": [
"portrait",
"landscapeLeft",
"landscapeRight",
"portraitUpsideDown"
]
}

With the above config file I got rid of the field missing error. If you notice the difference is that webAppPath changed to inputPath.

However this was not enough to complete packaging, since now the build halts at the following input:


Updated file c:\wamp\www\volive\build\proguard.cfg

No error, no success, it just hangs.

Better luck than me on your quest! Sencha 2 is becoming an excellent framework, with vast potential, lets hope these small wrinkles get sorted out before release!

Rui

juanhernandezgomez
28 Feb 2012, 9:59 AM
Thanks Rui for replying ...

The problem I had was that the command "sencha package generate" generated a wrong JSON config template. The iconName field was wrong ... the tool writes "iconName:" instead of "iconName" (notice the colon)!!

It was generating the inputPath field correctly for me but thanks to your config file I spotted the other error.

I was able to generate the Android APK after that.

I'm using Sencha Command v.2.0.0 Beta.
I post the config template and the output log in case it helps somebody:



{
"applicationName":"Presidents",
"applicationId":"com.bearingpoint.presidents",
"iconName":"icon.png",
"versionString":"1.0",
"outputPath":"C:/Data/Juan/Projects/Temp/MobileTemp/Sencha/Presidents/web/build/",
"inputPath":"C:/Data/Juan/Projects/Temp/MobileTemp/Sencha/Presidents/web/",
"configuration":"Debug",
"platform":"Android",
"deviceType":"Universal",
"certificatePath":"C:/Data/Juan/Projects/Temp/MobileTemp/Sencha/Presidents/res/native/Presidents.keystore",
"certificateAlias":"Presidents",
"sdkPath":"C:/Opt/Android/SDK/android-sdk-windows",
"orientations": [
"portrait",
"landscapeLeft",
"landscapeRight",
"portraitUpsideDown"
]
}


sencha package run config.json


Created project directory: C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build
Created directory C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\src\com\bearingpoint\presidents
Added file C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\src\com\bearingpoint\presidents\STActivity.java
Created directory C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\res
Created directory C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\bin
Created directory C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\libs
Created directory C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\res\values
Added file C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\res\values\strings.xml
Created directory C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\res\layout
Added file C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\res\layout\main.xml
Added file C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\AndroidManifest.xml
Added file C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\build.xml
Added file C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\proguard.cfg
Buildfile: C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\build.xml


-set-mode-check:


-set-debug-files:


-set-debug-mode:


-debug-obfuscation-check:


-setup:
[echo] Gathering info for Presidents...
[setup] Android SDK Tools Revision 16
[setup] Project Target: Android 2.1
[setup] API level: 7
[setup]
[setup] ------------------
[setup] Resolving library dependencies:
[setup] No library dependencies.
[setup]
[setup] ------------------
[setup]


-build-setup:
[echo] Creating output directories if needed...
[mkdir] Created dir: C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\bin\res
[mkdir] Created dir: C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\gen
[mkdir] Created dir: C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\bin\classes


-pre-build:


-code-gen:
[echo] ----------
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[renderscript] No RenderScript files to compile.
[echo] ----------
[echo] Handling Resources...
[aapt] Generating resource IDs...


-pre-compile:


-compile:
[javac] Compiling 2 source files to C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\bin\classes


-post-compile:


-obfuscate:


-dex:
[dex] Converting compiled files and external libraries into C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\bin\clas
ses.dex...


-crunch:
[crunch] Crunching PNG Files in source dir: C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\res
[crunch] To destination dir: C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\bin\res
[crunch] Processing image to cache: C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\res\drawable-hdpi\icon.png => C:\Da
ta\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\bin\res\drawable-hdpi\icon.png
[crunch] Processing image to cache: C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\res\drawable-ldpi\icon.png => C:\Da
ta\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\bin\res\drawable-ldpi\icon.png
[crunch] Processing image to cache: C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\res\drawable-mdpi\icon.png => C:lib
png error: Read Error
[crunch] libpng error: Read Error
[crunch] libpng error: Read Error
[crunch] \Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\bin\res\drawable-mdpi\icon.png
[crunch] Crunched 3 PNG files to update cache


-package-resources:
[aapt] Creating full resource package...
[aapt] (skipping (null) file 'C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\assets\touch\resources\themes\style
sheets\sencha-touch\default\_all.scss')
[aapt] (skipping (null) file 'C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\assets\touch\resources\themes\style
sheets\sencha-touch\default\_core.scss')
[aapt] (skipping (null) file 'C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\assets\touch\resources\themes\style
sheets\sencha-touch\default\_global.scss')
[aapt] (skipping (null) file 'C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\assets\touch\resources\themes\style
sheets\sencha-touch\default\_mixins.scss')
[aapt] (skipping (null) file 'C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\assets\touch\resources\themes\style
sheets\sencha-touch\default\_variables.scss')
[aapt] (skipping (null) file 'C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\assets\touch\resources\themes\style
sheets\sencha-touch\default\_widgets.scss')
[aapt] (skipping (null) file 'C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\assets\touch\resources\themes\style
sheets\sencha-touch\default\core\_core.scss')
[aapt] (skipping (null) file 'C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\assets\touch\resources\themes\style
sheets\sencha-touch\default\core\_layout.scss')
[aapt] (skipping (null) file 'C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\assets\touch\resources\themes\style
sheets\sencha-touch\default\core\_reset.scss')
[aapt] (skipping (null) file 'C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\assets\touch\resources\themes\style
sheets\sencha-touch\default\widgets\_buttons.scss')
[aapt] (skipping (null) file 'C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\assets\touch\resources\themes\style
sheets\sencha-touch\default\widgets\_carousel.scss')
[aapt] (skipping (null) file 'C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\assets\touch\resources\themes\style
sheets\sencha-touch\default\widgets\_form-sliders-basic.scss')
[aapt] (skipping (null) file 'C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\assets\touch\resources\themes\style
sheets\sencha-touch\default\widgets\_form-sliders.scss')
[aapt] (skipping (null) file 'C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\assets\touch\resources\themes\style
sheets\sencha-touch\default\widgets\_form.scss')
[aapt] (skipping (null) file 'C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\assets\touch\resources\themes\style
sheets\sencha-touch\default\widgets\_img.scss')
[aapt] (skipping (null) file 'C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\assets\touch\resources\themes\style
sheets\sencha-touch\default\widgets\_indexbar.scss')
[aapt] (skipping (null) file 'C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\assets\touch\resources\themes\style
sheets\sencha-touch\default\widgets\_list.scss')
[aapt] (skipping (null) file 'C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\assets\touch\resources\themes\style
sheets\sencha-touch\default\widgets\_loading-spinner.scss')
[aapt] (skipping (null) file 'C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\assets\touch\resources\themes\style
sheets\sencha-touch\default\widgets\_map.scss')
[aapt] (skipping (null) file 'C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\assets\touch\resources\themes\style
sheets\sencha-touch\default\widgets\_media.scss')
[aapt] (skipping (null) file 'C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\assets\touch\resources\themes\style
sheets\sencha-touch\default\widgets\_msgbox.scss')
[aapt] (skipping (null) file 'C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\assets\touch\resources\themes\style
sheets\sencha-touch\default\widgets\_panel.scss')
[aapt] (skipping (null) file 'C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\assets\touch\resources\themes\style
sheets\sencha-touch\default\widgets\_picker.scss')
[aapt] (skipping (null) file 'C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\assets\touch\resources\themes\style
sheets\sencha-touch\default\widgets\_sheets.scss')
[aapt] (skipping (null) file 'C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\assets\touch\resources\themes\style
sheets\sencha-touch\default\widgets\_tabs.scss')
[aapt] (skipping (null) file 'C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\assets\touch\resources\themes\style
sheets\sencha-touch\default\widgets\_toolbar-forms.scss')
[aapt] (skipping (null) file 'C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\assets\touch\resources\themes\style
sheets\sencha-touch\default\widgets\_toolbar.scss')


-package:
[apkbuilder] Current build type is different than previous build: forced apkbuilder run.
[apkbuilder] Creating Presidents-debug-unaligned.apk and signing it with a debug key...


-do-debug:
[zipalign] Running zip align on final apk...
[echo] Debug Package: C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\bin\Presidents-debug.apk


debug:
[propertyfile] Creating new property file: C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\bin\build.prop
[propertyfile] Updating property file: C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\bin\build.prop
[propertyfile] Updating property file: C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\bin\build.prop
[propertyfile] Updating property file: C:\Data\Juan\Projects\Temp\MobileTemp\Sencha\Presidents\web\build\bin\build.prop


BUILD SUCCESSFUL
Total time: 16 seconds
pkg: /data/local/tmp/Presidents.apk
Success
Starting: Intent { cmp=com.bearingpoint.presidents/.STActivity }
""C:/Opt/Android/SDK/android-sdk-windows/tools/android" create project --target android-7 --name Presidents --activity STActivity --path "C:
/Data/Juan/Projects/Temp/MobileTemp/Sencha/Presidents/web/build//" --package com.bearingpoint.presidents"

Jaganlal
5 Mar 2012, 7:56 PM
@juanhernandezgomez (http://www.sencha.com/forum/member.php?168067-juanhernandezgomez) you saved my life!!!

deepak_patil1222
22 Jun 2012, 12:57 AM
when is do sencha package build <my_config_file.json>

it builds the .apk file at the specified location but it gives some error at last in console... After Success.

BUILD SUCCESSFUL
Total time: 18 seconds
""C:/Program Files/Android/android-sdk/tools/android" create project --target an
droid-7 --name MyFirstApplication --activity STActivity --path "../apk_file/" --
package com.vistaar.myFirstAppID"
[ERROR] Error: Project folder 'C:\apk_file' is not empty. Please consider using
'android.bat update' instead.
Copy operation failed src=.//resources/incons/icon.png dst=../apk_file//res/draw
able-ldpi/icon.png
Copy operation failed src=.//resources/incons/icon.png dst=../apk_file//res/draw
able-mdpi/icon.png
Copy operation failed src=.//resources/incons/icon.png dst=../apk_file//res/draw
able-hdpi/icon.png

i am little confused now what to do ?

after i install the generated apk on one of the android emulators it doest nothing... so there must be some problem at the time of building the apk file itself.

One more thing i would like to specify which i noted is :

if i do the "platform":"AndroidEmulator", in the configuration file then it does nothing it just comes out and gives blank screen... can you please help me out here ..

My SDK is 2.0.1.1

worthlutz
25 Jun 2012, 5:21 PM
if i do the "platform":"AndroidEmulator", in the configuration file then it does nothing it just comes out and gives blank screen... can you please help me out here ..

I never got "platform":"AndroidEmulator" to work. Just use "platform":"Android". It works for the emulator.

Worth

deepak_patil1222
11 Jul 2012, 6:58 AM
Hey everyone.....

I was able to create the apk file for my sample application :). I changed the "iconName" in my configuration file and it worked. Actually i was giving the full path there which is wrong . According to sencha generated package file we need to give the icon name only and the icon file should be present at the same location where the configuration file is kept.

But now since i have done with the apk file creation when i install my apk file in android emulator and execute it , It only shows the blank screen to me.:"> I am very surprised to see that as it works on web layer.

if you have any inputs please help me here.

Thanks
Deepak