[TIMOB-14992] CLI: Python error (TypeError: not all arguments converted during string formatting) when building package for App Store
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Won't Fix |
Resolution Date | 2014-04-02T05:39:35.000+0000 |
Affected Version/s | Release 3.2.0 |
Fix Version/s | 2014 Sprint 07, 2014 Sprint 07 Tooling |
Components | CLI |
Labels | n/a |
Reporter | Tijs Zwinkels |
Assignee | Chris Barber |
Created | 2013-08-26T05:20:40.000+0000 |
Updated | 2017-03-20T16:49:23.000+0000 |
Description
*Problem*
Some .js files seem to trigger an error in the build-system when building for production:
*Note*
I've seen this bug more often lately. Most of my app is build in coffeescript, which might produce unusual (but legal) javascript patterns.
I think the bug is similar to #TC-1838, but I can reproduce it!
*Error*
[ERROR] Exception occured while building Android project:
[ERROR] Traceback (most recent call last):
[ERROR] File "/Users/tijs/Library/Application Support/Titanium/mobilesdk/osx/3.2.0/android/builder.py", line 2630, in <module>
[ERROR] builder.build_and_run(True, None, key, password, alias, output_dir)
[ERROR] File "/Users/tijs/Library/Application Support/Titanium/mobilesdk/osx/3.2.0/android/builder.py", line 2293, in build_and_run
[ERROR] compiler.compile(compile_bytecode=self.compile_js, external_modules=self.modules)
[ERROR] File "/Users/tijs/Library/Application Support/Titanium/mobilesdk/osx/3.2.0/android/compiler.py", line 287, in compile
[ERROR] self.compile_into_bytecode(self.js_files)
[ERROR] File "/Users/tijs/Library/Application Support/Titanium/mobilesdk/osx/3.2.0/android/compiler.py", line 202, in compile_into_bytecode
[ERROR] self.compile_javascript(fullpath)
[ERROR] File "/Users/tijs/Library/Application Support/Titanium/mobilesdk/osx/3.2.0/android/compiler.py", line 192, in compile_javascript
[ERROR] sys.stderr.write("[ERROR] unrecognized error encountered: " % se)
[ERROR] TypeError: not all arguments converted during string formatting
[ERROR] : Build process exited with code 1
[ERROR] : Project failed to build after 52s 350ms
*Steps to reproduce*
1. Include the attached file in a project
2. Build for 'Distribute - Android App store'
3. The error will appear.
Attachments
File | Date | Size |
---|---|---|
demonstrateCrash.js | 2013-08-26T05:20:40.000+0000 | 3887 |
After modifying the compiler.py script to show the error (as explained here: http://developer.appcelerator.com/question/137414/titanium-appcelerator-android-fails-to-build-with-exception-for-tiandroidcompilejs), it became clear that the closure-compiler would crash on the .js file:
Updating the closure-compiler fixes this problem. See pull request: https://github.com/appcelerator/titanium_mobile/pull/4602
Here's [~tinkertank]'s 3.1.x pull request: https://github.com/appcelerator/titanium_mobile/pull/4604
Thanks for the pull request, however we rewrote the Android build scripts to be more awesome and now we use UglifyJS.
Closing ticket as the issue will not fix.