Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2881] Android: 1.8.0.1 won't build on Windows

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionFixed
Resolution Date2011-12-19T16:31:32.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsStudio
Labelsn/a
ReporterIvan Skugor
AssigneeShak Hossain
Created2011-11-09T06:39:14.000+0000
Updated2016-03-08T07:47:50.000+0000

Description

I wanted to try out new V8 engine, but can't compile my application (enabling/disabling V8 has no influence). Compiling new blank project also fails. Here is trace log:
[ERROR] Exception occured while building Android project:
[ERROR] Traceback (most recent call last):
[ERROR]   File "D:\Application Data\Titanium\mobilesdk\win32\1.8.0.1\android\builder.py", line 2034, in <module>
[ERROR]     s.build_and_run(True, avd_id, device_args=device_args)
[ERROR]   File "D:\Application Data\Titanium\mobilesdk\win32\1.8.0.1\android\builder.py", line 1772, in build_and_run
[ERROR]     self.copy_project_resources()
[ERROR]   File "D:\Application Data\Titanium\mobilesdk\win32\1.8.0.1\android\builder.py", line 668, in copy_project_resources
[ERROR]     requireIndex.generateJSON(self.assets_dir, os.path.join(self.assets_dir, "index.json"))
[ERROR]   File "D:\Application Data\Titanium\mobilesdk\win32\1.8.0.1\android\requireIndex.py", line 18, in generateJSON
[ERROR]     index[os.path.join(os.path.relpath(dirpath, projectDir), name)] = 1
[ERROR] AttributeError: 'module' object has no attribute 'relpath'

Comments

  1. Zdenek Farana 2011-11-18

    I believe the building process uses Python older than 2.6 (relpath was introduced in 2.6). My workaround was defining own relpath function inside requireIndex.py file. I've used following implementation: http://www.saltycrane.com/blog/2010/03/ospathrelpath-source-code-python-25/. The build started to work after patching that. However, my app didn't work properly either (I don't know, it seems no events were firing etc.), so I can't confirm if the workaround truly solves the issue.
  2. Ivan Skugor 2011-11-18

    Yeah, I tried the same thing, build process can run (from second attempt), but app won't run (some JSON file doesn't get generated). I stopped debugging there, Python is language I don't know (although, I would like to learn it) and I don't have much time to explore. I also tried to install new version of Python as described in Wiki, but that doesn't seem to have affect. Next week I'll have 32-bit Windows back, 64-bit doesn't have any meaning anyway when everything else is 32-bit. Hope then I'll succeed to compile my project and finally see how v8 performs.
  3. Ivan Skugor 2011-11-21

    I tried with Windows 32-bit, but getting same error.
  4. Ivan Skugor 2011-11-25

    I managed to compile simple project by using this fix: requireIndex.py
       

    Upgrade Python versions less than 2.5...

    if not hasattr(os.path, "relpath"): # If this is being run on earlier versions of Python than 2.6, monkeypatch # in something resembling missing standard library functionality. if sys.version_info[0] == 2 and sys.version_info[1] < 6: def relpath(longPath, basePath): if not longPath.startswith(basePath): raise RuntimeError("Unexpected arguments") if longPath == basePath: return "." i = len(basePath) if not basePath.endswith(os.path.sep): i += len(os.path.sep) return longPath[i:] os.path.relpath = relpath
    So, I think it's obvious that the problem is old version of Python that build scripts use (I hope this will be upgraded yesterday :) ).
  5. Ivan Skugor 2011-12-08

    Thanks for accepting this issue, fixing it and letting me know! Don't know when or what fixed this issue, but now it works without a fix from my last comment. I tested with: * Titanium SDK version: 1.8.0.1 (12/07/11 18:04 264c7fc...) * Titanium Studio, build: 1.0.7.201112061404 * Windows XP
  6. Paul Dowsett 2011-12-19

    Ivan I am sorry that it has taken this long to review your ticket. We are attempting to improve this going forward. Thank you for your very conscientious use of JIRA; in the way you file reports, help other users, and report back when you have discovered that your tickets have been fixed (as you have with this one). It's all very much noted and appreciated. I will close this, in response to your last comment.
  7. Ivan Skugor 2011-12-20

  8. Shak Hossain 2014-01-12

    Ivan, Closing this issues since the issue can't be reproduced with 3.2GA

JSON Source