Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1998] A rendering function causes UI freezes on Android when code is included with Ti.include(). Does not occur when same function is copied with eval() and then called.

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionHold
Resolution Date2013-03-15T18:37:20.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsandroid, crash, triage, ui
ReporterMatthias Zaugg
AssigneeMauro Parra-Miranda
Created2012-11-01T13:34:58.000+0000
Updated2016-03-08T07:40:56.000+0000

Description

I have an app that exposes a single variable( var api = {}; ) to the global scope. The app is glued together with Ti.include() by including different files that all contain a self-executing anonymous function containing code, which extends the api-var with functionality. There is a content renderer function, which accepts some JSON data and a window as parameters and then renders some controls based on the JSON data on the window. This function is contained in a single file(ContentRenderer.js in gist). This rendering function is used by other components. Here the problem occurs: When this function is used, it causes random but regular UI freezes(ANR) on Android devices. Strangely this does not happen when i make a copy(not by reference) of the function with eval(). The problematic lines in the code can be found in the following gist in the file ContentModule.js line 14-19: https://gist.github.com/3993412 The gist contains also the logfile from Dalvik Debug Monitor.

Comments

  1. Daniel Sefton 2012-11-07

    Hi Matthias, We'd like to be able to reproduce this without spending time guessing unprovided code. If you could fill in the blanks in a new project and post a self-contained runnable test case ASAP that would be most useful. Cheers.
  2. Ingo Muschenetz 2013-03-15

    Waiting on updated code. When provided, we will reopen.

JSON Source