Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3186] Android: Persistent internal compiler error

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-10-19T01:12:05.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 21, 2013 Sprint 21 Core, Release 3.2.0
ComponentsAndroid, Tooling
Labelsandroidbuild, ay-verified, cb-verified, core
ReporterDaniel Cameron
AssigneeChris Barber
Created2011-04-15T03:39:00.000+0000
Updated2013-11-13T01:27:54.000+0000

Description

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

Attachments

FileDateSize
bigint.js2011-04-15T03:39:01.000+000050446

Comments

  1. Justyna Kowalska 2013-05-07

    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.
  2. Allen Yeung 2013-10-19

    PR: https://github.com/appcelerator/titanium_mobile/pull/4781
  3. Samuel Dowse 2013-11-13

    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.

JSON Source