Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18199] iOS: iOS modules can not build if there any JS files inside assets folder

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2015-08-24T01:56:05.000+0000
Affected Version/sRelease 3.5.0
Fix Version/sRelease 4.0.0
ComponentsiOS, Tooling
Labelsqe-3.5.0
ReporterKajenthiran Velummaylum
AssigneeFeon Sua Xin Miao
Created2014-12-15T07:19:56.000+0000
Updated2017-03-16T22:09:31.000+0000

Description

iOS modules can not be built if there are any JS files inside the root assets folder.

Steps To Reproduce

1. Create an iOS module 2. Place a javascript file with some code in the assets folder at the root. 3. Build the module

Expected Result

Module should build as usual

Actual Result

CLI is throwing following error.
Traceback (most recent call last):
  File "build.py", line 262, in <module>
    compile_js(manifest,config)
  File "build.py", line 84, in compile_js
    root_asset, module_assets = compiler.compile_module()
  File "/Users/kvelummaylum/Library/Application Support/Titanium/mobilesdk/osx/3.5.0.v20141211124115/iphone/compiler.py", line 431, in compile_module
    root_asset = self.compile_commonjs_file(self.appid+'.js', os.path.join(self.assets_dir, self.appid+'.js'))
  File "/Users/kvelummaylum/Library/Application Support/Titanium/mobilesdk/osx/3.5.0.v20141211124115/iphone/compiler.py", line 564, in compile_commonjs_file
    self.compile_js_file(path, from_, js_files)
  File "/Users/kvelummaylum/Library/Application Support/Titanium/mobilesdk/osx/3.5.0.v20141211124115/iphone/compiler.py", line 578, in compile_js_file
    self.compile_js_asset_file(path,from_)
  File "/Users/kvelummaylum/Library/Application Support/Titanium/mobilesdk/osx/3.5.0.v20141211124115/iphone/compiler.py", line 545, in compile_js_asset_file
    file_contents = open(os.path.expanduser(file)).read()
IOError: [Errno 2] No such file or directory: '/Users/kvelummaylum/Documents/Appcelerator_Studio_Workspace/ModuleTest/iphone/assets/ti.iostest.js'

Workaround

We need to move the assets folder inside iphone folder.

Attachments

FileDateSize
HelloWorld.zip2015-08-21T17:48:43.000+0000219157

Comments

  1. Feon Sua Xin Miao 2014-12-16

    PR: https://github.com/appcelerator/titanium_mobile/pull/6487 Functional Test: 1. Create an iOS module :
     ti create -p ios -t module -d . -n test -u http:// --id com.example.test 
    2. Create a JS file follow the naming convention of \[module id\].js, in this case com.example.test.js, under the test/assets folder 3. In the module platform folder, run
     ./build.py 
    4. The module should be built with no error \\ NOTE: According to [iOS Module Development Guide](http://docs.appcelerator.com/titanium/3.0/#!/guide/iOS_Module_Development_Guide) {quote} Starting with Release 3.3.0, the Titanium CLI generates a module project containing multiple platforms. The module contains platform folders, for example, iphone, that contain platform-specific resources and common folders for assets, documentation and examples. {quote}
  2. Tim Poulsen 2015-02-06

    CR & FR passed, PR merged
  3. Eric Wieber 2015-03-12

    Verified fixed using: Titanium SDK 4.0.0.v20150312092612 Studio 4.0.0.201503062102 CLI 3.4.2 Xcode 6.2 Node 0.12 Module building completed without error.
  4. Feon Sua Xin Miao 2015-08-21

    https://github.com/appcelerator/titanium_mobile/pull/7060
  5. Chee Kiat Ng 2015-08-24

    APPROVED. PR merged.
  6. Lee Morris 2017-03-16

    Closing ticket as fixed.

JSON Source