[TIMOB-6820] Android: Build fails when Java keywords are used in project app id
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-03-14T10:06:09.000+0000 |
Affected Version/s | Release 1.8.0.1 |
Fix Version/s | Release 2.0.0, Sprint 2012-06 |
Components | Android |
Labels | android, module_build, qe-and021312, qe-testadded |
Reporter | Tony Lukasavage |
Assignee | Chase Culpepper |
Created | 2011-12-21T11:31:40.000+0000 |
Updated | 2012-03-15T10:15:10.000+0000 |
Description
If you enter a Java keyword as the first part of your project's app id, it can cause Android build errors.
Steps to Reproduce
1. Create a new mobile project in Titanium Studio 2. give your project the app id *case.test* 3. make sure Android is selected as a deployment target 4. Create the project 5. Attempt to build the app You should get an error like this
[ERROR] Error(s) compiling generated Java code
[ERROR] /Users/tlukasavage/Documents/Titanium Studio Workspace/case_test/build/android/gen/case/test/ApplicationStylesheet.java:5: <identifier> expected
If you look at that line in the identified file, you'll find that *case* from *case.test* is the offender
/**
* Appcelerator Titanium
* WARNING: This is a generated file. Do not modify.
*/
package case.test; // this is line 5
import java.util.HashMap;
To confirm that the same problem occurs when "package" is used as the app id. See build.log below. Please note that an app with a reserved word, such as "package", in its *project name* but with an app id that does not contain any reserved words, launches without an issue, despite what is stated in TIMOB-2554. Hence: * Project name: "package" // this packages successfully * App id: "com.appcelerator.package" // this breaks packaging
I added a note to the wiki guides about not using Java keywords. https://wiki.appcelerator.org/display/guides/Hello+World
Verified that using one of the keywords in the app ID will still cause the build to fail, but will warn: [ERROR] Do not use java keywords for project app id, such as case Checked with Titanium Studio, build: 1.0.8.201201262211 and SDK 1.9.0.v20120207000134
Re-opening as conditionally Not Fixed. App ID values containing: true, false, and null exhibit the old behavior. Log: --- [ERROR] Error(s) compiling generated Java code [ERROR] /Users/dhyde/Documents/Titanium Studio Workspace/null/build/android/gen/com/appcelerator/true/ApplicationStylesheet.java:5:
Closing bug. Verified fix; Studio will not allow you to create projects that have Java keywords in the app id: SDK build: 2.0.0.v20120315091738 Titanium Studio, build: 2.0.0.201203142055 OS: Mac OS X Lion (10.7.2)