Question

I have created a android app with Sencha Touch 2 and PhoneGap, and the .apk file is more than 8 MB which is extreme!

So I was trying to find a solution to minimize the size. So I found the solution in the sencha's documentation (http://docs-origin.sencha.com/cmd/3.1.2/#!/guide/native_packaging-section-cfg). But following that solution didn't work. running this command -> sencha app build native generates error (http://pastebin.com/CQL6XukX).

Also running this command ->sencha fs minify app.js app.minified.js gives an error like this -> [ERR] null

I can't find any other solution. Please anyone help me to find a solution to minify the size of the app?

Was it helpful?

Solution

Hard to tell based on the error message what/where the error is, but if I had to guess you're missing a comma somewhere. The stack trace says:

[INF] Completed compilation.
[INF] Processed remote file touch/sencha-touch.js
[INF] Processed local file app.js
[ERR] C2000: Rhino Parse Error (invalid property id =>             float: true,) -- unknown-file:7049176
[ERR] C2000: Rhino Parse Error (syntax error =>             float: true,) -- unknown-file:7049177

Cmd gets far enough to compile all of your classes into a single file, then barfs on the minification.

So (again, guessing here) I would run your code through JSLint hunting for syntax errors... maybe you missed a comma after an "id" property and immediately before a "float" property.

Sencha Cmd would be the way to go... but make sure the two products (Sencha Touch and Sencha Cmd) are using the most recent versions as sometimes you might run into a mismatched pair.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top