{ "id": "124212", "key": "TIMOB-16148", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "15817", "description": "2014 Sprint 01", "name": "2014 Sprint 01", "archived": true, "released": true, "releaseDate": "2014-01-17" }, { "id": "15819", "description": "2014 Sprint 01 Core", "name": "2014 Sprint 01 Core", "archived": true, "released": true, "releaseDate": "2014-01-17" }, { "id": "15971", "description": "Release 3.2.3", "name": "Release 3.2.3", "archived": false, "released": true, "releaseDate": "2014-04-30" }, { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-01-17T01:07:22.000+0000", "created": "2013-12-27T04:15:33.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "alloy", "andoid", "bug", "compile", "localization", "module_cli", "qe-closed-3.2.3", "qe-testadded" ], "versions": [ { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "issuelinks": [], "assignee": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "updated": "2014-08-01T07:45:41.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "13103", "name": "CLI", "description": "Node-based command line interface" } ], "description": "When trying to compile a ally android project, the compiler fail with the following error:\r\n{code:xml}\r\n[ERROR] : Failed to compile Java source files:\r\n[ERROR] : \r\n[ERROR] : /Users/mor_eli/Development/Titanium_Workspace/android_alloy/build/android/gen/com/android/alloy/R.java:32: ';' expected\r\n[ERROR] : public static final int space test=0x7f040001;\r\n[ERROR] : ^\r\n[ERROR] : /Users/mor_eli/Development/Titanium_Workspace/android_alloy/build/android/gen/com/android/alloy/R.java:32: expected\r\n[ERROR] : public static final int space test=0x7f040001;\r\n[ERROR] : ^\r\n[ERROR] : 2 errors\r\n[ERROR] Application Installer abnormal process termination. Process exit value was 1\r\n{code}\r\nThe issue seemed to be linked to having a localization string file in project root/i18n/en/strings.xml\r\n\r\nIf the first string line has a space as follows:\r\n{code:xml}\r\n\r\n\r\n\tshould not work with space/string>\r\n\r\n{code}\r\nThe compilation fails.\r\nIf the space is removed:\r\n{code:xml}\r\n\r\n\r\n\tshould work no space/string>\r\n\r\n{code}\r\n\r\nThe compilation works.", "attachment": [ { "id": "44831", "filename": "Project.zip", "author": { "name": "mor_eli", "key": "mor_eli", "displayName": "Eli Mor", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-27T04:15:33.000+0000", "size": 6900376, "mimeType": "application/zip" } ], "flagged": false, "summary": "Android Does Not Compile With Space in Localization String", "creator": { "name": "mor_eli", "key": "mor_eli", "displayName": "Eli Mor", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "mor_eli", "key": "mor_eli", "displayName": "Eli Mor", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Mac OSX 10.9.1\r\nTitanium SDK 3.2.0.GA\r\nTitanium Studio, build: 3.2.0.201312191547", "comment": { "comments": [ { "id": "285930", "author": { "name": "sfeather", "key": "sfeather", "displayName": "Stephen Feather", "active": true, "timeZone": "America/New_York" }, "body": "Kind of works as I'd expect it to.\n\nhttp://developer.android.com/guide/topics/resources/string-resource.html\n\n", "updateAuthor": { "name": "sfeather", "key": "sfeather", "displayName": "Stephen Feather", "active": true, "timeZone": "America/New_York" }, "created": "2013-12-27T04:30:03.000+0000", "updated": "2013-12-27T04:30:03.000+0000" }, { "id": "285933", "author": { "name": "mor_eli", "key": "mor_eli", "displayName": "Eli Mor", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Stephen, do you ever sleep? :)\nThanks for the link. \nClearly it shows that no spaces are allowed. Maybe there's a way to handle it more gracefully, or to match the compilation between iOS and android. The same code ran without a problem on iOS, but when going to run it on android the problem popped up.", "updateAuthor": { "name": "mor_eli", "key": "mor_eli", "displayName": "Eli Mor", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-27T04:57:43.000+0000", "updated": "2013-12-27T04:57:43.000+0000" }, { "id": "288149", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "Took a look and the problem is originating in the Android platform code. It can't find the resource and returns the default value.\r\n\r\nI tried replacing the spaces with &\\#160; at build time, but that didn't help. I imagine this is a step in the right direction, though the resource loader would have to be looked at and thus I've assigned this to one of the Android devs, namely Ping.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2014-01-14T21:58:24.000+0000", "updated": "2014-01-14T21:58:49.000+0000" }, { "id": "288370", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "After doing some testing, iOS does support spaces in the name.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2014-01-15T23:41:25.000+0000", "updated": "2014-01-15T23:41:25.000+0000" }, { "id": "288392", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This isn't supported in native Android because the string names are being imported directly to R.java as variables, so you can't have a space in the name. ", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-01-16T00:59:20.000+0000", "updated": "2014-01-16T00:59:20.000+0000" }, { "id": "288397", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "Decided to display an error message with the offending string names. It's not perfect, but such is life.\n\nMaster pull request: https://github.com/appcelerator/titanium_mobile/pull/5232\n3.2.x pull request: https://github.com/appcelerator/titanium_mobile/pull/5233\n\nTo test:\n1. create an android app\n2. create the file i18n/en/strings.xml\n3. add a few strings with spaces like this:\n\n{code}\n\n\n\thello world!\n\tthis is so rad\n\n{code}\n\n4. build the app and witness the awesome error handling\n5. set: ti config android.excludeInvalidI18nStrings true\n6. build the app again and see that the errors are printed, but the build proceeds", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2014-01-16T01:39:26.000+0000", "updated": "2014-01-16T01:39:26.000+0000" }, { "id": "298757", "author": { "name": "nmittal", "key": "nmittal", "displayName": "Neha Mittal", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Verified fix using below environment:\r\n\r\nAppc Studio: 3.2.3.201403250634\r\nSDK build: 3.2.3.v20140325145222\r\nacs: 1.0.14\r\nnpm: 1.3.2\r\nalloy:1.3.1\r\nCLI: titanium@3.2.3-dev\r\ntitanium-code-processor:1.1.0\r\nXcode: 5.1\r\nOsx: Maverick(10.9.2)\r\nDevice: Nexus 7 (V 4.4.2)\r\n\r\nTested with above steps provided in the comments and after setting ti config android.excludeInvalidI18nStrings true, errors are printed but the build proceeds as expected.\r\n\r\nHence closing the issue.", "updateAuthor": { "name": "nmittal", "key": "nmittal", "displayName": "Neha Mittal", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2014-03-26T07:04:01.000+0000", "updated": "2014-03-26T07:04:01.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }