[TIMOB-6739] MobileWeb: Unable to package project in Titanium Studio
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-12-19T11:13:58.000+0000 |
Affected Version/s | Release 1.8.0.1 |
Fix Version/s | Release 1.8.0.1, Sprint 2011-51, Release 2.0.0, Release 1.8.1 |
Components | MobileWeb |
Labels | verified-1.8.0.1 |
Reporter | Ingo Muschenetz |
Assignee | Chris Barber |
Created | 2011-12-17T11:12:35.000+0000 |
Updated | 2012-08-27T13:43:12.000+0000 |
Description
I seem to be unable to package a project for MobileWeb in Titanium Studio.
Steps to replicate:
Install 1.8.0.1.RC2
Create a new mobile project, selecting at least Mobile Web as a platform
Make sure the selected SDK in tiapp.xml is 1.8.0.1.RC2
Choose Deploy > Package Mobile Web
Select "Copy Mobile Web app to a directory" and select a location on your file system
Click "Finish"
A dialog comes up with "Failed to package project" To diagnose, turn on Preferences > Studio > Troubleshooting, turn the slider to "ALL" and checkmark "Debug specific components", clicking on "com.aptana.core/debug/shell". Exit the preference dialog. Re-run the build and once the error happens, view the log file. At the bottom is the command used to run the builder. For me, it is: "/usr/bin/python" "/Library/Application Support/Titanium/mobilesdk/osx/1.8.0.1.RC2/mobileweb/builder.py" "/Users/ingo/Documents/Aptana Studio 3 Workspace/rc2test" "production" Running that on the command line results in:
[DEBUG] found: /Library/Application Support/Titanium/mobilesdk/osx/1.8.0.1.RC2/mobileweb/src/screen.js
[DEBUG] found: /Library/Application Support/Titanium/mobilesdk/osx/1.8.0.1.RC2/mobileweb/src/interactable.js
[DEBUG] found: /Library/Application Support/Titanium/mobilesdk/osx/1.8.0.1.RC2/mobileweb/src/clickable.js
[DEBUG] found: /Library/Application Support/Titanium/mobilesdk/osx/1.8.0.1.RC2/mobileweb/src/eventdriven.js
[DEBUG] found: /Library/Application Support/Titanium/mobilesdk/osx/1.8.0.1.RC2/mobileweb/src/styleable.js
Traceback (most recent call last):
File "/Library/Application Support/Titanium/mobilesdk/osx/1.8.0.1.RC2/mobileweb/builder.py", line 21, in <module>
main(sys.argv)
File "/Library/Application Support/Titanium/mobilesdk/osx/1.8.0.1.RC2/mobileweb/builder.py", line 18, in main
compiler.Compiler(project_dir,deploytype)
File "/Library/Application Support/Titanium/mobilesdk/osx/1.8.0.1.RC2/mobileweb/compiler.py", line 189, in __init__
titanium_js += '%s;\n' % self.load_api(api_file, api)
File "/Library/Application Support/Titanium/mobilesdk/osx/1.8.0.1.RC2/mobileweb/compiler.py", line 285, in load_api
return jspacker.jsmin(file_contents)
File "/Library/Application Support/Titanium/mobilesdk/osx/1.8.0.1.RC2/mobileweb/jspacker.py", line 39, in jsmin
JavascriptMinify().minify(ins, outs)
File "/Library/Application Support/Titanium/mobilesdk/osx/1.8.0.1.RC2/mobileweb/jspacker.py", line 213, in minify
self._jsmin()
File "/Library/Application Support/Titanium/mobilesdk/osx/1.8.0.1.RC2/mobileweb/jspacker.py", line 204, in _jsmin
self._action(1)
File "/Library/Application Support/Titanium/mobilesdk/osx/1.8.0.1.RC2/mobileweb/jspacker.py", line 159, in _action
raise UnterminatedRegularExpression()
jspacker.UnterminatedRegularExpression
Note...switching from "production" to "development" makes the above command line work.
I don't believe this is Titanium Studio specific, unless TiStudio is using the wrong command-line options.
Your commands are correct. We've never tested "production". Only "development". I'm not surprised it doesn't work.
Note that it _did_ work in the R1 release (and previous versions), so the break is recent.
After reading the error more closely, I see that jsmin (jspacker.py) doesn't like the following line's regex:
Specifically, it's dying on the escaped "(". In any case, it's not a bug in mobileweb's code, but rather in jsmin. I tried updating jsmin to the latest version, but things broke badly. Instead of wasting time getting jsmin to work, I'd prefer to switch to Closure compiler (TIMOB-5997).
As it is, people can't package mobileweb at all in this release if they use Studio with RC2. What should I recommend as a work-around?
Well, since mobileweb isn't production ready, don't call builder with "production". Use "development" mode.
Pull request: https://github.com/appcelerator/titanium_mobile/pull/1044
To test, from Ti Studio, click Deploy > Package - Mobile Web. If you don't get any errors and the mobile web app launches, it worked!
Verified as fixed in 1.8.0.1. SDK: 1.8.0.1.v20111219111633 Studio: 1.0.7.201112152014 OS: OS X Lion, Windows 7, Ubuntu 10.04 Browsers Tested: Chrome