Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6739] MobileWeb: Unable to package project in Titanium Studio

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2011-12-19T11:13:58.000+0000
Affected Version/sRelease 1.8.0.1
Fix Version/sRelease 1.8.0.1, Sprint 2011-51, Release 2.0.0, Release 1.8.1
ComponentsMobileWeb
Labelsverified-1.8.0.1
ReporterIngo Muschenetz
AssigneeChris Barber
Created2011-12-17T11:12:35.000+0000
Updated2012-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.

Comments

  1. Ingo Muschenetz 2011-12-17

    I don't believe this is Titanium Studio specific, unless TiStudio is using the wrong command-line options.
  2. Chris Barber 2011-12-17

    Your commands are correct. We've never tested "production". Only "development". I'm not surprised it doesn't work.
  3. Ingo Muschenetz 2011-12-17

    Note that it _did_ work in the R1 release (and previous versions), so the break is recent.
  4. Chris Barber 2011-12-17

    After reading the error more closely, I see that jsmin (jspacker.py) doesn't like the following line's regex:
       return /^url\(/.test(url) ? url : "url(" + Ti._5.getAbsolutePath(url) + ")";
       
    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).
  5. Ingo Muschenetz 2011-12-17

    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?
  6. Chris Barber 2011-12-17

    Well, since mobileweb isn't production ready, don't call builder with "production". Use "development" mode.
  7. Chris Barber 2011-12-17

    Pull request: https://github.com/appcelerator/titanium_mobile/pull/1044
  8. Chris Barber 2011-12-17

    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!
  9. Dustin Hyde 2011-12-19

    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

JSON Source