Error Message:
[INFO] Compiling Javascript Resources ...
[ERROR] Error in compiler. , 'utf8' codec can't decode byte 0x8e in position 324: unexpected code byte; Traceback (most recent call last):
File "C:\ProgramData\Titanium\mobilesdk\win32\1.5.1\android\builder.py", line 1548, in s.build_and_run(False,avd_id)
File "C:\ProgramData\Titanium\mobilesdk\win32\1.5.1\android\builder.py", line 1307, in build_and_run compiler.compile()
File "C:\ProgramData\Titanium\mobilesdk\win32\1.5.1\android\compiler.py", line 239, in compile js_contents = self.make_function_from_file(fullpath, pack=False)
File "C:\ProgramData\Titanium\mobilesdk\win32\1.5.1\android\compiler.py", line 183, in make_function_from_file file_contents = codecs.open(path,'r',encoding='utf-8').read()
File "C:\ProgramData\Titanium\modules\win32\python\1.0.0\lib\codecs.py", line 618, in read return self.reader.read(size)
File "C:\ProgramData\Titanium\modules\win32\python\1.0.0\lib\codecs.py", line 424, in read newchars, decodedbytes = self.decode(data, self.errors)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x8e in position 324: unexpected code byte
Version Info:
* Titanium Mobile 1.5.1
* Android SDK r8 and r9
Repo Steps:
* Create a new titanium project
* Add attached BigInt.js to the /Resources directory
* Recompile *Error occurs here*
* Remove BigInt.js from /Resources directory
* Recompile *Compiler error still occurs*
It appears that the entire titanium mobile project is trashed
from this point and will not recompile again.
Edit: fixed the formatting
I had a similar issue (just different byte and position). My fix: 1. Open emulator 2. Wipe out your app cache and data and uninstall it 3. Remove build folder and build log file. 4. Create new project in titanium 5. Place the file that wasn't utf-8 encoded in the new project 6. The file will be red marked, an error should show up in Problems tab 7. Use quick-fix to utf-8 encode file 8. Move the fixed file to old project I noticed that when I changed encoding in external editor like notepad++, titanium didn't mark it but still took it for wrongly encoded file. Hope it helps someone.
PR: https://github.com/appcelerator/titanium_mobile/pull/4781
Verified fixed on: Mac OSX 10.9 Mavericks Titanium Studio, build: 3.2.0.201311122029 Titanium SDK, build: 3.2.0.v20131112144044 CLI: 3.2.0 Alloy: 1.3.0 Project successfully builds and installs on: Android Emulator: 2.3.3 Android Device: Xperia U (2.3.7), Xperia Arc S (4.0.4) No compiler error is thrown. Closing.