Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20588] iOS: Log messages are not always displayed on compile time

GitHub Issuen/a
TypeBug
PriorityMedium
StatusResolved
ResolutionCannot Reproduce
Resolution Date2016-11-28T22:14:13.000+0000
Affected Version/sRelease 5.2.0, Release 5.4.0
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterAngel Petkov
AssigneeAngel Petkov
Created2016-03-17T21:58:53.000+0000
Updated2016-11-28T22:14:13.000+0000

Description

The first Ti.API.info message will not be displayed every time the app is launched. Its inconsistent and will be displayed sometimes when the app is cleaned and launched but very rarely. If Ti.API.info is called after being compiled, everything is logged as expected. This issue only persists if running through studio , all works as expected through Xcode
Ti.API.info("Wont be displayed");
var win = Ti.UI.createWindow({
  backgroundColor: 'white',
  exitOnClose: true,
  fullscreen: false,
  layout: 'vertical',
  title: 'Label Demo'
});

var label1 = Ti.UI.createLabel({
  color: '#900',
  font: { fontSize:12 },
  text: 'A simple label',
  textAlign: Ti.UI.TEXT_ALIGNMENT_CENTER,
  top: 30,
  width: Ti.UI.SIZE, height: Ti.UI.SIZE
});

label1.addEventListener("click",function(e){
	Ti.API.info("Will be Displayed");
});

win.add(label1);
win.open();

Attachments

FileDateSize
bug.gif2016-08-06T00:05:26.000+00009085079

Comments

  1. Hans Knöchel 2016-03-20

    Guess this is main-thread related. If you set #define TI_USE_KROLL_THREAD in the defines.h, does that change something in behavior?
  2. Angel Petkov 2016-03-21

    This only happens when running through studio, I tried adding the run on main thread to the XML however to no effect. it also works if you invoke a proxy so if you get the property of an object and pass it in to the log. Then it will get executed on compile time otherwise not.
  3. Angel Petkov 2016-03-22

    PR pending : https://github.com/appcelerator/titanium_mobile/pull/7875. Maybe we should back port this. If its okay with you [~cng] ?
  4. Chee Kiat Ng 2016-03-23

    we don't have to back port this. let's discuss during planning.
  5. Wilson Luu 2016-08-06

    Reopening ticket. I can consistently reproduce this issue if you do the following:

    Create a classic app with the above code: appc new --classic

    Install to simulator; you *may* see the "Wont be displayed" message after the app is launched on the simulator

    Kill the running project process, control + c, and clean your project: appc ti clean

    Install the same project to simulator

    The first log will not appear when the app launches on simulator; see bug.gif

    Tested on: Appc CLI NPM: 4.2.7 Appc CLI Core: 5.4.0-40 Arrow: 1.8.2 SDK: 5.4.0.v20160804185318 Node: v4.4.7 OS: Mac OS X (10.11.6) Xcode: 7.3.1 Device: iphone simulator 6 (9.3)
  6. Josh Longton 2016-08-16

    I am seeing this error inconsistently on the 10 Betas, steps I used:

    Create a classic app

    Clear the app.js then add var adView = Ti.UI.iOS.createAdView(); and Ti.API.warn("########### Here");

    Install to simulator/device, inconsistently no logs will be shown.

    Clean the project: Project > Clean

    Install the same project to simulator/device.

    Inconsistently no logs will be shown.

    Tested on: {noformat} Appc CLI NPM: 4.2.7 Appc CLI Core: 5.4.0.GA SDK: 5.5.0.v20160815115302 Studio: 4.7.0.201607250649 Node: v4.4.4 OS: Mac OS X (10.11.6) Xcode: 8 beta 6 Device: iPhone simulator 6s (10.0), iPhone 6 (10.0) {noformat}
  7. Angel Petkov 2016-08-22

    Im having trouble reproducing this issue now, tried with 5.3.0.GA and 5.4.X. However when i was able to reproduce it would happen only with studio regardless if app-thinking or main-thread is enabled. However, would work through x-code so its most likley a CLI issue. Im using xcode 7.3 to test and xcode 8.0 beta 3, both on 8.2 and 9.3 device
  8. Hans Knöchel 2016-11-28

    This issue should not be reproducible anymore, having our logger changed for this and other use-cases in 6.0.0.

JSON Source