[TIMOB-8305] MobileWeb: If an app does not contain Resources/mobileweb/apple_startup_images, the build process crashes.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-03-26T16:05:26.000+0000 |
Affected Version/s | Release 2.0.0 |
Fix Version/s | Release 2.0.0, Sprint 2012-07 |
Components | MobileWeb |
Labels | qe-port |
Reporter | Bryan Hughes |
Assignee | Chris Barber |
Created | 2012-03-26T08:53:05.000+0000 |
Updated | 2012-08-13T10:18:01.000+0000 |
Description
If the apple startup images folder does not exist, then the compiler crashes with:
Traceback (most recent call last):
File "/Library/Application Support/Titanium/mobilesdk/osx/2.0.0/mobileweb/builder.py", line 21, in <module>
main(sys.argv)
File "/Library/Application Support/Titanium/mobilesdk/osx/2.0.0/mobileweb/builder.py", line 18, in main
compiler.Compiler(project_dir,deploytype)
File "/Library/Application Support/Titanium/mobilesdk/osx/2.0.0/mobileweb/compiler.py", line 95, in __init__
self.copy(os.path.join(self.resources_path, 'mobileweb', 'apple_startup_images', 'Default.jpg'), self.build_path)
File "/Library/Application Support/Titanium/mobilesdk/osx/2.0.0/mobileweb/compiler.py", line 624, in copy
shutil.copy(src_path, dest_path)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 116, in copy
copyfile(src, dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 81, in copyfile
with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: 'workspace/Sample.Mapping/Resources/mobileweb/apple_startup_images/Default.jpg'
Because of this issue, any projects created by users prior to 2.0 will crash.
This is because someone created a project with the old directory layout. I'll add checks to see that the files exist first.
FYI the projects in question are all of the samples that Ping created, Kitchen Sink, Bravo, NBC, and everything else I could get my hands on.
Pull request: https://github.com/appcelerator/titanium_mobile/pull/1848
Verified fix on: Titanium studio : 2.1.1.201207271312 SDK version : 2.2.0.v20120810194112 Android 4.0.4 - default ,chrome 18.0 Iphone 4.3.5 - safari mobile Mountain lion(10.8) - chrome 21.0,safari 6,firefox 14.0.1