简体   繁体   English

压缩Sencha Touch应用程序

[英]Compressing Sencha Touch App

I have created a android app with Sencha Touch 2 and PhoneGap, and the .apk file is more than 8 MB which is extreme! 我用Sencha Touch 2和PhoneGap创建了一个android应用程序,并且.apk文件超过8 MB,这是极端的!

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 ). 因此,我在sencha的文档( 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 ). 运行此命令-> sencha app build native将生成错误( http://pastebin.com/CQL6XukX )。

Also running this command ->sencha fs minify app.js app.minified.js gives an error like this -> [ERR] null 同时运行此命令-> sencha fs minify app.js app.minified.js会给出这样的错误-> [ERR] null

I can't find any other solution. 我找不到其他解决方案。 Please anyone help me to find a solution to minify the size of the app? 请任何人帮助我找到最小化应用程序大小的解决方案?

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. Cmd足够远,可以将所有类编译为一个文件,然后在缩小文件时使用barfs。

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. 因此,(再次在这里猜测)我将通过JSLint寻找语法错误来运行您的代码...也许您在“ id”属性之后和紧接在“ float”属性之前错过了逗号。

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. Sencha Cmd将是要走的路...但是请确保两个产品(Sencha Touch和Sencha Cmd)使用的是最新版本,因为有时您可能会遇到不匹配的情况。

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

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