Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2373] After enabling cloud push services, Android doesn't compile throwing UnicodeDecodeError

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNeeds more info
Resolution Date2013-04-06T19:34:28.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsStudio, Titanium SDK & CLI
Labelsandroid, studio, unicode, unicodedecodeerror, utf-8
ReporterShahar Zrihen
AssigneeMauro Parra-Miranda
Created2012-11-28T00:48:16.000+0000
Updated2016-03-08T07:41:24.000+0000

Description

After add Ti.cloudpush module, android can't compile a production apk with UTF8 text in AndroidManifest.

I have an app with a hebrew (utf8) name. When I add the push notification module, it stops compiling and throws a "UnicodeDecodeError: 'ascii' codec can't decode byte 0xd7 in position 336: ordinal not in range(128)" error.

Test case

Create a new app, give it a UTF8 name with an AndroidManifest.xml file. Add Ti.cloudpush module. try to compile the app for distribution.

Logs

[ERROR] Exception occured while building Android project:
[ERROR] Traceback (most recent call last):
[ERROR]   File "/Users/Shahar/Library/Application Support/Titanium/mobilesdk/osx/2.1.4.v20121030173408/android/builder.py", line 2301, in <module>
[ERROR]     s.build_and_run(True, None, key, password, alias, output_dir)
[ERROR]   File "/Users/Shahar/Library/Application Support/Titanium/mobilesdk/osx/2.1.4.v20121030173408/android/builder.py", line 2053, in build_and_run
[ERROR]     self.manifest_changed = self.generate_android_manifest(compiler)
[ERROR]   File "/Users/Shahar/Library/Application Support/Titanium/mobilesdk/osx/2.1.4.v20121030173408/android/builder.py", line 1250, in generate_android_manifest
[ERROR]     custom_manifest_contents = fill_manifest(custom_manifest_contents)
[ERROR]   File "/Users/Shahar/Library/Application Support/Titanium/mobilesdk/osx/2.1.4.v20121030173408/android/builder.py", line 1177, in fill_manifest
[ERROR]     manifest_source = manifest_source.replace(ti_permissions,permissions_required_xml)
[ERROR] UnicodeDecodeError: 'ascii' codec can't decode byte 0xd7 in position 336: ordinal not in range(128)
My Manifest file -
<application
        android:icon="@drawable/appicon"
        android:label="??????"
        android:name="QuestionnaireApplication"
        android:debuggable="false"
    >
        <activity
            android:name=".QuestionnaireActivity"
            android:label="??????"
            android:theme="@style/Theme.Titanium"
            android:screenOrientation="portrait"
            android:configChanges="keyboardHidden"
        >

Discussions

http://developer.appcelerator.com/question/145133/after-enabling-cloud-services-i-get-unicodedecodeerror-when-compiling-for-android#comment-148283 http://stackoverflow.com/questions/13595837/titanium-appcelerator-after-enabling-cloud-services-i-get-unicodedecodeerror-w

Comments

  1. Shahar Zrihen 2012-12-18

    Any updates on the subject?
  2. Daniel Sefton 2013-04-06

    Your AndroidManifest.xml doesn't seem complete... You don't escape the XML tags like . Can you provide your actual manifest, or one which reproduces the issue in a simple app? I added the cloudpush module, added an AndroidManifest.xml file replaced what you have between both android:label properties with hebrew. It builds for production fine with 3.0.2 GA.

JSON Source