[TIMOB-2601] Android: Adding code that calls Titanium.Platform requires full rebuild
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:59:34.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.6.0 M01 |
Components | Android |
Labels | android, defect, kroll, release-1.6.0 |
Reporter | Bill Dawson |
Assignee | Marshall Culpepper |
Created | 2011-04-15T03:24:07.000+0000 |
Updated | 2011-04-17T01:59:34.000+0000 |
Description
Reproduce
- Create a new Titanium project. Don't add any code to it yet.
- Launch it.
- After it launches, edit app.js and add
Ti.API.info("Android version: " + Ti.Platform.version);
. - Save app.js and re-launch the application.
- Look at logcat. Instead of setting the
info()
message successfully, you'll see:
E/KrollContext( 4552): (kroll$1) [11,317] ECMA Error evaluating source: TypeError: Cannot read property "version" from undefined (app://app.js#9)
E/KrollContext( 4552): org.mozilla.javascript.EcmaError: TypeError: Cannot read property "version" from undefined (app://app.js#9)
E/KrollContext( 4552): at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3761)
E/KrollContext( 4552): at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3739)
E/KrollContext( 4552): at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3767)
(etc)
- "touch" the tiapp.xml and relaunch.
- Now you'll see the correct message.
cf #2475 as well -- user seems to have had same problem and fixed by touching tiapp.xml.
cf http://developer.appcelerator.com/helpdesk/view/60961">http://developer.appcelerator.com/helpdesk/view/60961
Customer is reporting that app built with "Distribute" (which, i believe, does a full rebuild), also exhibits this problem.
(from [681f5403fe6b5fe4a582fdc672882445f079cd96]) run android.create when a JS file is changed, in case new modules are detected and source needs to be generated in the App.java [#2601
state:fixed-in-qa]
https://github.com/appcelerator/titanium_mobile/commit/681f5403fe6b5fe4a582fdc672882445f079cd96"> https://github.com/appcelerator/titanium_mobile/commit/681f5403fe6b...
(from [6f51f9891c23e670591df1545bf4cdfb5e15f9a3]) run android.create when a JS file is changed, in case new modules are detected and source needs to be generated in the App.java [#2601
state:fixed-in-qa]
https://github.com/appcelerator/titanium_mobile/commit/6f51f9891c23e670591df1545bf4cdfb5e15f9a3"> https://github.com/appcelerator/titanium_mobile/commit/6f51f9891c23...
[INFO] Titanium SDK version: 1.6.0 (01/10/11 08:25 3452f06)