[TIMOB-20588] iOS: Log messages are not always displayed on compile time
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Resolved |
Resolution | Cannot Reproduce |
Resolution Date | 2016-11-28T22:14:13.000+0000 |
Affected Version/s | Release 5.2.0, Release 5.4.0 |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Angel Petkov |
Assignee | Angel Petkov |
Created | 2016-03-17T21:58:53.000+0000 |
Updated | 2016-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
File | Date | Size |
---|---|---|
bug.gif | 2016-08-06T00:05:26.000+0000 | 9085079 |
Guess this is main-thread related. If you set
#define TI_USE_KROLL_THREAD
in the defines.h, does that change something in behavior?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.
PR pending : https://github.com/appcelerator/titanium_mobile/pull/7875. Maybe we should back port this. If its okay with you [~cng] ?
we don't have to back port this. let's discuss during planning.
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)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();
andTi.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}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
This issue should not be reproducible anymore, having our logger changed for this and other use-cases in 6.0.0.