Titanium相同檔名會拋出錯誤

大部分的程式,只要檔名大小寫不同,就會視為不同的檔案,但是在titanium編譯的時候,則會發生錯誤,因為titanium不允許在相同資料夾裡,有相同的檔案名稱。因為之前一直是用tishadow測試,都沒遇到這個問題,最後要build在device上,就遇到了以下錯誤。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[ERROR] /home/sparrow/Works/test/build/android/bin/assets/Resources/actions/IndexAction.js: error: File is case-insensitive equivalent to: /home/sparrow/Works/ec2/test/build/android/bin/assets/Resources/actions/indexAction.js
[ERROR] Exception occured while building Android project:
[ERROR] Traceback (most recent call last):
[ERROR] File "/home/sparrow/.titanium/mobilesdk/linux/3.1.2.GA/android/builder.py", line 2621, in <module>
[ERROR] builder.build_and_run(True, avd_id, device_args=device_args, debugger_host=debugger_host, profiler_host=profiler_host)
[ERROR] File "/home/sparrow/.titanium/mobilesdk/linux/3.1.2.GA/android/builder.py", line 2400, in build_and_run
[ERROR] launched, launch_failed = self.package_and_deploy()
[ERROR] File "/home/sparrow/.titanium/mobilesdk/linux/3.1.2.GA/android/builder.py", line 1867, in package_and_deploy
[ERROR] unsigned_apk = self.create_unsigned_apk(ap_, webview_js_files)
[ERROR] File "/home/sparrow/.titanium/mobilesdk/linux/3.1.2.GA/android/builder.py", line 1679, in create_unsigned_apk
[ERROR] resources_zip = zipfile.ZipFile(resources_zip_file)
[ERROR] File "/usr/lib/python2.7/zipfile.py", line 701, in __init__
[ERROR] self.fp = open(file, modeDict[mode])
[ERROR] IOError: [Errno 2] No such file or directory: '/home/sparrow/Works/ec2/test/build/android/bin/app.ap_'
[ERROR] Build process exited with code 1
[ERROR] Project failed to build after 1m 40s 422ms

解決方法就是更換其中一個檔案的名稱,有了這次教訓…,以後盡量不使用相同檔案名稱。