Titanium Crashes After Building JS resources.

You must Login before you can answer or comment on any questions.

My projects worked fine until today. Now when I compile them I get the following:

[ERROR] Exception occured while building Android project: [ERROR] Traceback (most recent call last): [ERROR] File "C:\ProgramData\Titanium\mobilesdk\win32\1.6.2\android\builder.py", line 1646, in <module> [ERROR] s.build_and_run(False, avd_id) [ERROR] File "C:\ProgramData\Titanium\mobilesdk\win32\1.6.2\android\builder.py", line 1407, in build_and_run [ERROR] compiler.compile() [ERROR] File "C:\ProgramData\Titanium\mobilesdk\win32\1.6.2\android\compiler.py", line 239, in compile [ERROR] js_contents = self.make_function_from_file(fullpath, pack=False) [ERROR] File "C:\ProgramData\Titanium\mobilesdk\win32\1.6.2\android\compiler.py", line 183, in make_function_from_file [ERROR] file_contents = codecs.open(path,'r',encoding='utf-8').read() [ERROR] File "C:\ProgramData\Titanium\modules\win32\python\1.0.0\lib\codecs.py", line 618, in read [ERROR] return self.reader.read(size) [ERROR] File "C:\ProgramData\Titanium\modules\win32\python\1.0.0\lib\codecs.py", line 424, in read [ERROR] newchars, decodedbytes = self.decode(data, self.errors) [ERROR] UnicodeDecodeError: 'utf8' codec can't decode byte 0x92 in position 549: unexpected code byte

The really strange part is that if I make a new project it compiles. Then, I moved the files from the used to work project over to the new project one at a time to see which one is causing Titanium to crash. Once it crashes, I removed the possibly bad file from the project directory. It still does not compile.

I even reverted the code and file structure of the new project back to the starter code which should work perfectly and I still get this crash. Has anyone experienced something like this before?

BTW I don't have any crazy libraries or extensions installed. Just the Titanium and Android SDK. Yes I already copied the adb file over to tools.

— asked 2 years ago by Jose Benavides
2 Comments
  • Hi Jose.

    I think you have illegal UTF8 character somewhere in the project.

    Where is location of that character is hard to find because error message isn't very descriptive. You can try out commenting different parts of your project and then try to compile. That way you can, step by step, find where illegal character is.

    Maybe there is easier method, but I'm not aware of it.

    Hope this helps.

    — commented 2 years ago by Ivan Škugor

  • I'm getting the exact same problem. I've commented out code, meticulously combed through it all for strange characters and still nothing. I even reinstalled titanium just on the off chance it might repair a potentially damaged file. The previous installation of the app on the emulator works fine.

    The Kitchen sink works fine too, annoyingly.

    — commented 2 years ago by Robert Mullen

1 Answer

Accepted Answer

Okay I just got this fixed. I think the secret was simply to calm down first. My problem was indeed an illegal utf-8 character.

I suggest you either comb your files for suspect characters or convert your files to utf-8 in your IDE. If it doesn't work after conversion you'll need to go through all of your files manually.

Hope you get it fixed.

Your Answer

Think you can help? Login to answer this question!