Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15645] Andorid: CLI: Legacy flag does not work on CLI

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-11-04T09:16:20.000+0000
Affected Version/sRelease 3.2.0
Fix Version/s2013 Sprint 23, 2013 Sprint 23 Core, Release 3.2.0
ComponentsAndroid, CLI
Labelscli, qe-closed-3.2.0
ReporterAllen Yeung
AssigneeChris Barber
Created2013-11-02T22:16:51.000+0000
Updated2014-06-19T12:43:23.000+0000

Description

Test steps: Running something like "ti build -p android --avd-id 14 --avd-skin HVGA --legacy" will return an error:
Traceback (most recent call last):
  File "/Library/Application Support/Titanium/mobilesdk/osx/3.2.0/android/builder.py", line 2546, in <module>
    builder = Builder(project_name,sdk_dir,project_dir,template_dir,app_id,is_emulator)
  File "/Library/Application Support/Titanium/mobilesdk/osx/3.2.0/android/builder.py", line 458, in __init__
    android_creator.create(parent_dir, project_dir=self.top_dir, build_time=True)
  File "/Users/ayeung/titanium/titanium_mobile/dist/mobilesdk/osx/3.2.0/android/android.py", line 341, in create
    app_properties = self.app_properties, app_info = self.app_info)
  File "/Users/ayeung/titanium/titanium_mobile/dist/mobilesdk/osx/3.2.0/android/android.py", line 110, in render
    tmpl = self.load_template(os.path.join(template_dir, 'templates','build' , template_file))
  File "/Users/ayeung/titanium/titanium_mobile/dist/mobilesdk/osx/3.2.0/android/android.py", line 102, in load_template
    return Template(filename=template, output_encoding='utf-8', encoding_errors='replace')
  File "/Users/ayeung/titanium/titanium_mobile/dist/mobilesdk/osx/3.2.0/common/mako/template.py", line 93, in __init__
    (code, module) = _compile_text(self, file(filename).read(), filename)
  File "/Users/ayeung/titanium/titanium_mobile/dist/mobilesdk/osx/3.2.0/common/mako/template.py", line 250, in _compile_text
    node = lexer.parse()
  File "/Users/ayeung/titanium/titanium_mobile/dist/mobilesdk/osx/3.2.0/common/mako/lexer.py", line 160, in parse
    if self.match_python_block():
  File "/Users/ayeung/titanium/titanium_mobile/dist/mobilesdk/osx/3.2.0/common/mako/lexer.py", line 276, in match_python_block
    self.append_node(parsetree.Code, self.escape_code(text), match.group(1)=='!', lineno=line, pos=pos)
  File "/Users/ayeung/titanium/titanium_mobile/dist/mobilesdk/osx/3.2.0/common/mako/lexer.py", line 94, in append_node
    node = nodecls(*args, **kwargs)
  File "/Users/ayeung/titanium/titanium_mobile/dist/mobilesdk/osx/3.2.0/common/mako/parsetree.py", line 127, in __init__
    self.code = ast.PythonCode(text, **self.exception_kwargs)
  File "/Users/ayeung/titanium/titanium_mobile/dist/mobilesdk/osx/3.2.0/common/mako/ast.py", line 30, in __init__
    expr = pyparser.parse(code.lstrip(), "exec", **exception_kwargs)
  File "/Users/ayeung/titanium/titanium_mobile/dist/mobilesdk/osx/3.2.0/common/mako/pyparser.py", line 37, in parse
    raise exceptions.SyntaxException("(%s) %s (%s)" % (e.__class__.__name__, str(e), repr(code[0:50])), **exception_kwargs)
mako.exceptions.SyntaxException: (SyntaxError) invalid syntax (<unknown>, line 1) (u'- !!tiapp.analytics \n') in file '/Users/ayeung/titanium/titanium_mobile/dist/mobilesdk/osx/3.2.0/android/templates/build/AppInfo.java' at line: 56 char: 10
This could be related to the fact that the templates were moved. After resolving this issue, we will most likely need to modify AppInfo.java to include the new getDeployType() method as well. Another thing to note is that the '-T device' flag does not seem to work for legacy either. It just assumes that it is an emulator and prompts the user for an avd-id.

Comments

  1. Chris Barber 2013-11-04

    Pull request: https://github.com/appcelerator/titanium_mobile/pull/4905
  2. Chris Barber 2013-11-04

    To test, run:
       ti build -p android --legacy --avd-id <pick a number> --avd-skin <pick a skin>
       
  3. Olga Romero 2013-11-08

    Tested with: CLI 3.2.0 (git://github.com/appcelerator/titanium.git) Alloy 1.3.3 Titanium SDK, build: 3.2.0.v20131107161747 Clean the project first before running command 'ti build' Project built successfully and launched on Emulator.

JSON Source