Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2601] Android: Adding code that calls Titanium.Platform requires full rebuild

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:59:34.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.6.0 M01
ComponentsAndroid
Labelsandroid, defect, kroll, release-1.6.0
ReporterBill Dawson
AssigneeMarshall Culpepper
Created2011-04-15T03:24:07.000+0000
Updated2011-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.

Comments

  1. Bill Dawson 2011-04-15

    cf #2475 as well -- user seems to have had same problem and fixed by touching tiapp.xml.

  2. Bill Dawson 2011-04-15

    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.

  3. Marshall Culpepper 2011-04-15

    (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...

  4. Marshall Culpepper 2011-04-15

    (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...

  5. Thomas Huelbert 2011-04-15

    [INFO] Titanium SDK version: 1.6.0 (01/10/11 08:25 3452f06)

JSON Source