org.mozilla.javascript.EcmaError: ReferenceError: "detailWindow" is not defined. (app://ui.js#1(eval)#1)

Appcelerator JIRA | Eric Merriman | 5 years ago
  1. 0

    Description: For speed, we packaged our module test applications into APKs and then installed them via adb. When the applications were run on device most (but not all) failed with runtime errors produced when the tableview row was clicked. Console output: {code} E/RhinoObject( 2176): (KrollRuntimeThread) [840,3335] ReferenceError: "detailWindow" is not defined. (app://ui.js#1(eval)#1) E/RhinoObject( 2176): org.mozilla.javascript.EcmaError: ReferenceError: "detailWindow" is not defined. (app://ui.js#1(eval)#1) E/RhinoObject( 2176): at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3784) E/RhinoObject( 2176): at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3762) E/RhinoObject( 2176): at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3847) E/RhinoObject( 2176): at org.mozilla.javascript.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1846) E/RhinoObject( 2176): at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1785) E/RhinoObject( 2176): at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1780) E/RhinoObject( 2176): at script(app://ui.js#1(eval):1) E/RhinoObject( 2176): at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854) E/RhinoObject( 2176): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164) E/RhinoObject( 2176): at org.mozilla.javascript.ScriptRuntime.evalSpecial(ScriptRuntime.java:2598) E/RhinoObject( 2176): at org.mozilla.javascript.ScriptRuntime.callSpecial(ScriptRuntime.java:2450) E/RhinoObject( 2176): at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1567) E/RhinoObject( 2176): at script(app://ui.js:1) E/RhinoObject( 2176): at script(app://ui.js:2) E/RhinoObject( 2176): at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854) E/RhinoObject( 2176): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164) E/RhinoObject( 2176): at org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2520) E/RhinoObject( 2176): at org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:300) E/RhinoObject( 2176): at org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:129) E/RhinoObject( 2176): at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:76) E/RhinoObject( 2176): at org.appcelerator.kroll.runtime.rhino.js.events._c_anonymous_2(/tmp/events.js:49) E/RhinoObject( 2176): at org.appcelerator.kroll.runtime.rhino.js.events.call(/tmp/events.js) E/RhinoObject( 2176): at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:86) E/RhinoObject( 2176): at org.appcelerator.kroll.runtime.rhino.js.events._c_anonymous_3(/tmp/events.js:99) E/RhinoObject( 2176): at org.appcelerator.kroll.runtime.rhino.js.events.call(/tmp/events.js) E/RhinoObject( 2176): at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426) E/RhinoObject( 2176): at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3177) E/RhinoObject( 2176): at org.appcelerator.kroll.runtime.rhino.js.events.call(/tmp/events.js) E/RhinoObject( 2176): at org.appcelerator.kroll.runtime.rhino.RhinoObject.fireEvent(RhinoObject.java:73) E/RhinoObject( 2176): at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:441) E/RhinoObject( 2176): at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:602) E/RhinoObject( 2176): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) E/RhinoObject( 2176): at ti.modules.titanium.ui.TableViewProxy.handleMessage(TableViewProxy.java:578) E/RhinoObject( 2176): at android.os.Handler.dispatchMessage(Handler.java:95) E/RhinoObject( 2176): at android.os.Looper.loop(Looper.java:132) E/RhinoObject( 2176): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:102) E/TiJSError( 2176): (main) [14,3349] ----- Titanium Javascript Runtime Error ----- E/TiJSError( 2176): (main) [0,3349] - In app://ui.js#1(eval):1,0 E/TiJSError( 2176): (main) [0,3349] - Message: ReferenceError: "detailWindow" is not defined. (app://ui.js#1(eval)#1) E/TiJSError( 2176): (main) [1,3350] - Source: null {code} Steps to reproduce: 1) Import attached project into studio 2) Set Tiapp.xml to 1.8.01 or later 3) package for distribution to android marketplace. 4) Use adb to install APK 5) Run the app 6) Select "acceptance tab" 7) Select any item in the tableview Result: Runtime error, usually relating to "reference error, detail window is not defined" but we have seen other things Occurs on: Packaged APKs installed to device SDK 1.8.0.1 SDK 1.8.1 SDK 1.8.2 (master branch) V8 and Rhino DOES NOT occur on: "run on device" builds SDK 1.7.5

    Appcelerator JIRA | 5 years ago | Eric Merriman
    org.mozilla.javascript.EcmaError: ReferenceError: "detailWindow" is not defined. (app://ui.js#1(eval)#1)
  2. 0

    Description: For speed, we packaged our module test applications into APKs and then installed them via adb. When the applications were run on device most (but not all) failed with runtime errors produced when the tableview row was clicked. Console output: {code} E/RhinoObject( 2176): (KrollRuntimeThread) [840,3335] ReferenceError: "detailWindow" is not defined. (app://ui.js#1(eval)#1) E/RhinoObject( 2176): org.mozilla.javascript.EcmaError: ReferenceError: "detailWindow" is not defined. (app://ui.js#1(eval)#1) E/RhinoObject( 2176): at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3784) E/RhinoObject( 2176): at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3762) E/RhinoObject( 2176): at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3847) E/RhinoObject( 2176): at org.mozilla.javascript.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1846) E/RhinoObject( 2176): at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1785) E/RhinoObject( 2176): at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1780) E/RhinoObject( 2176): at script(app://ui.js#1(eval):1) E/RhinoObject( 2176): at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854) E/RhinoObject( 2176): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164) E/RhinoObject( 2176): at org.mozilla.javascript.ScriptRuntime.evalSpecial(ScriptRuntime.java:2598) E/RhinoObject( 2176): at org.mozilla.javascript.ScriptRuntime.callSpecial(ScriptRuntime.java:2450) E/RhinoObject( 2176): at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1567) E/RhinoObject( 2176): at script(app://ui.js:1) E/RhinoObject( 2176): at script(app://ui.js:2) E/RhinoObject( 2176): at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854) E/RhinoObject( 2176): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164) E/RhinoObject( 2176): at org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2520) E/RhinoObject( 2176): at org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:300) E/RhinoObject( 2176): at org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:129) E/RhinoObject( 2176): at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:76) E/RhinoObject( 2176): at org.appcelerator.kroll.runtime.rhino.js.events._c_anonymous_2(/tmp/events.js:49) E/RhinoObject( 2176): at org.appcelerator.kroll.runtime.rhino.js.events.call(/tmp/events.js) E/RhinoObject( 2176): at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:86) E/RhinoObject( 2176): at org.appcelerator.kroll.runtime.rhino.js.events._c_anonymous_3(/tmp/events.js:99) E/RhinoObject( 2176): at org.appcelerator.kroll.runtime.rhino.js.events.call(/tmp/events.js) E/RhinoObject( 2176): at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426) E/RhinoObject( 2176): at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3177) E/RhinoObject( 2176): at org.appcelerator.kroll.runtime.rhino.js.events.call(/tmp/events.js) E/RhinoObject( 2176): at org.appcelerator.kroll.runtime.rhino.RhinoObject.fireEvent(RhinoObject.java:73) E/RhinoObject( 2176): at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:441) E/RhinoObject( 2176): at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:602) E/RhinoObject( 2176): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) E/RhinoObject( 2176): at ti.modules.titanium.ui.TableViewProxy.handleMessage(TableViewProxy.java:578) E/RhinoObject( 2176): at android.os.Handler.dispatchMessage(Handler.java:95) E/RhinoObject( 2176): at android.os.Looper.loop(Looper.java:132) E/RhinoObject( 2176): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:102) E/TiJSError( 2176): (main) [14,3349] ----- Titanium Javascript Runtime Error ----- E/TiJSError( 2176): (main) [0,3349] - In app://ui.js#1(eval):1,0 E/TiJSError( 2176): (main) [0,3349] - Message: ReferenceError: "detailWindow" is not defined. (app://ui.js#1(eval)#1) E/TiJSError( 2176): (main) [1,3350] - Source: null {code} Steps to reproduce: 1) Import attached project into studio 2) Set Tiapp.xml to 1.8.01 or later 3) package for distribution to android marketplace. 4) Use adb to install APK 5) Run the app 6) Select "acceptance tab" 7) Select any item in the tableview Result: Runtime error, usually relating to "reference error, detail window is not defined" but we have seen other things Occurs on: Packaged APKs installed to device SDK 1.8.0.1 SDK 1.8.1 SDK 1.8.2 (master branch) V8 and Rhino DOES NOT occur on: "run on device" builds SDK 1.7.5

    Appcelerator JIRA | 5 years ago | Eric Merriman
    org.mozilla.javascript.EcmaError: ReferenceError: "detailWindow" is not defined. (app://ui.js#1(eval)#1)
  3. 0

    h3.Problem Global namespace getting lost while separated in a bunch of files stored in different folders. In simulator the result differs from the one from device. h3.Reproducible Steps 1. Run the example project (attached inside JIRA) 2. Press "Click button" h3.Reproducible Code File Structure {code} Resources ¡-sub1 ¡-test.js ¡-sub2 ¡-testTwo.js ¡-app.js {code} test.js {code} (function(){ namespace.test = function(){ var winTest = Titanium.UI.createWindow({ title: 'Test', backgroundColor: '#fff', exitOnClose: true, fullscreen: false // making this a heavy weight window }); var btnButton = Ti.UI.createButton({ title: 'Click button', width: 150, height: 100, top: 100 }); btnButton.addEventListener('click', function(){ Ti.include('sub2/testTwo.js'); var winToOpen = namespace.testTwo(); winToOpen.open(); }); winTest.add(btnButton); namespace.printout(); return winTest; }; })(); {code} testTwo.js {code} (function(){ namespace.testTwo = function(){ var winTestTwo = Titanium.UI.createWindow({ title: 'Test2', backgroundColor: '#fff' }); var btnBack = Ti.UI.createButton({ title: 'back', height: 100, width: 100, top: 50 }); btnBack.addEventListener('click', function(){ winTestTwo.close(); }); winTestTwo.add(btnBack); return winTestTwo; }; })(); {code} app.js {code} //app.js var namespace = {}; Ti.include('sub1/test.js'); namespace.printout = function(){ Ti.API.info('namespace.printout'); }; var win = namespace.test(); win.open(); {code} h3.Logs while testing on Simulator (Android 2.2 & 2.3.3) with SDK 1.7.5 {code} 12-22 13:33:03.388: D/KrollContext(307): (kroll$2: file:///android_asset/Resources/app.js) [17896,19589] Running evaluated script: file:///android_asset/Resources/sub2/testTwo.js 12-22 13:33:03.606: E/KrollContext(307): (kroll$2: file:///android_asset/Resources/app.js) [173,19762] ECMA Error evaluating source: ReferenceError: "namespace" is not defined. (file:///android_asset/Resources/sub2/testTwo.js#2) 12-22 13:33:03.606: E/KrollContext(307): org.mozilla.javascript.EcmaError: ReferenceError: "namespace" is not defined. (file:///android_asset/Resources/sub2/testTwo.js#2) 12-22 13:33:03.606: E/KrollContext(307): at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3784) 12-22 13:33:03.606: E/KrollContext(307): at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3762) 12-22 13:33:03.606: E/KrollContext(307): at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3847) 12-22 13:33:03.606: E/KrollContext(307): at org.mozilla.javascript.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1846) 12-22 13:33:03.606: E/KrollContext(307): at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1785) 12-22 13:33:03.606: E/KrollContext(307): at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1780) 12-22 13:33:03.606: E/KrollContext(307): at script(file:///android_asset/Resources/sub2/testTwo.js:2) 12-22 13:33:03.606: E/KrollContext(307): at script(file:///android_asset/Resources/sub2/testTwo.js:1) 12-22 13:33:03.606: E/KrollContext(307): at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854) 12-22 13:33:03.606: E/KrollContext(307): at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:178) 12-22 13:33:03.606: E/KrollContext(307): at org.mozilla.javascript.Context.evaluateReader(Context.java:1142) 12-22 13:33:03.606: E/KrollContext(307): at org.appcelerator.titanium.kroll.KrollContext$DefaultEvaluator.evaluateFile(KrollContext.java:106) 12-22 13:33:03.606: E/KrollContext(307): at org.appcelerator.titanium.kroll.KrollContext.evaluateScript(KrollContext.java:353) 12-22 13:33:03.606: E/KrollContext(307): at org.appcelerator.titanium.kroll.KrollContext.handleEvalFile(KrollContext.java:382) 12-22 13:33:03.606: E/KrollContext(307): at org.appcelerator.titanium.kroll.KrollContext.evalFile(KrollContext.java:278) 12-22 13:33:03.606: E/KrollContext(307): at org.appcelerator.titanium.kroll.KrollBridge.evalFile(KrollBridge.java:130) 12-22 13:33:03.606: E/KrollContext(307): at org.appcelerator.titanium.TiContext.evalFile(TiContext.java:189) 12-22 13:33:03.606: E/KrollContext(307): at org.appcelerator.titanium.TiContext.evalFile(TiContext.java:209) 12-22 13:33:03.606: E/KrollContext(307): at ti.modules.titanium.TitaniumModule.include(TitaniumModule.java:122) 12-22 13:33:03.606: E/KrollContext(307): at ti.modules.titanium.TitaniumModuleBindingGen$14.invoke(TitaniumModuleBindingGen.java:571) 12-22 13:33:03.606: E/KrollContext(307): at org.appcelerator.kroll.KrollMethod.call(KrollMethod.java:51) 12-22 13:33:03.606: E/KrollContext(307): at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1701) 12-22 13:33:03.606: E/KrollContext(307): at script(file:///android_asset/Resources/sub1/test.js:18) 12-22 13:33:03.606: E/KrollContext(307): at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854) 12-22 13:33:03.606: E/KrollContext(307): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164) 12-22 13:33:03.606: E/KrollContext(307): at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426) 12-22 13:33:03.606: E/KrollContext(307): at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3177) 12-22 13:33:03.606: E/KrollContext(307): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162) 12-22 13:33:03.606: E/KrollContext(307): at org.appcelerator.titanium.kroll.KrollCallback.callSync(KrollCallback.java:139) 12-22 13:33:03.606: E/KrollContext(307): at org.appcelerator.titanium.kroll.KrollCallback$1.run(KrollCallback.java:164) 12-22 13:33:03.606: E/KrollContext(307): at android.os.Handler.handleCallback(Handler.java:587) 12-22 13:33:03.606: E/KrollContext(307): at android.os.Handler.dispatchMessage(Handler.java:92) 12-22 13:33:03.606: E/KrollContext(307): at android.os.Looper.loop(Looper.java:123) 12-22 13:33:03.606: E/KrollContext(307): at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:86) 12-22 13:33:03.606: E/TiJSError(307): (kroll$2: file:///android_asset/Resources/app.js) [45,19807] ----- Titanium Javascript Runtime Error ----- 12-22 13:33:03.606: E/TiJSError(307): (kroll$2: file:///android_asset/Resources/app.js) [5,19812] - In file:///android_asset/Resources/sub2/testTwo.js:2,0 12-22 13:33:03.606: E/TiJSError(307): (kroll$2: file:///android_asset/Resources/app.js) [2,19814] - Message: ReferenceError: "namespace" is not defined. (file:///android_asset/Resources/sub2/testTwo.js#2) 12-22 13:33:03.617: E/TiJSError(307): (kroll$2: file:///android_asset/Resources/app.js) [4,19818] - Source: null 12-22 13:33:03.717: E/KrollCallback(307): (kroll$2: file:///android_asset/Resources/app.js) [91,19909] ECMA Error evaluating source, invocation: [callMethod UI.Button.UI.Button:event:click null], message: TypeError: Cannot find function testTwo in object [object Object]. (file:///android_asset/Resources/sub1/test.js#19) 12-22 13:33:03.717: E/KrollCallback(307): org.mozilla.javascript.EcmaError: TypeError: Cannot find function testTwo in object [object Object]. (file:///android_asset/Resources/sub1/test.js#19) 12-22 13:33:03.717: E/KrollCallback(307): at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3784) 12-22 13:33:03.717: E/KrollCallback(307): at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3762) 12-22 13:33:03.717: E/KrollCallback(307): at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3790) 12-22 13:33:03.717: E/KrollCallback(307): at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3809) 12-22 13:33:03.717: E/KrollCallback(307): at org.mozilla.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3880) 12-22 13:33:03.717: E/KrollCallback(307): at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2359) 12-22 13:33:03.717: E/KrollCallback(307): at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2326) 12-22 13:33:03.717: E/KrollCallback(307): at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1514) 12-22 13:33:03.717: E/KrollCallback(307): at script(file:///android_asset/Resources/sub1/test.js:19) 12-22 13:33:03.717: E/KrollCallback(307): at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854) 12-22 13:33:03.717: E/KrollCallback(307): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164) 12-22 13:33:03.717: E/KrollCallback(307): at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426) 12-22 13:33:03.717: E/KrollCallback(307): at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3177) 12-22 13:33:03.717: E/KrollCallback(307): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162) 12-22 13:33:03.717: E/KrollCallback(307): at org.appcelerator.titanium.kroll.KrollCallback.callSync(KrollCallback.java:139) 12-22 13:33:03.717: E/KrollCallback(307): at org.appcelerator.titanium.kroll.KrollCallback$1.run(KrollCallback.java:164) 12-22 13:33:03.717: E/KrollCallback(307): at android.os.Handler.handleCallback(Handler.java:587) 12-22 13:33:03.717: E/KrollCallback(307): at android.os.Handler.dispatchMessage(Handler.java:92) 12-22 13:33:03.717: E/KrollCallback(307): at android.os.Looper.loop(Looper.java:123) 12-22 13:33:03.717: E/KrollCallback(307): at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:86) 12-22 13:33:03.717: E/TiJSError(307): (kroll$2: file:///android_asset/Resources/app.js) [7,19916] ----- Titanium Javascript Runtime Error ----- 12-22 13:33:03.717: E/TiJSError(307): (kroll$2: file:///android_asset/Resources/app.js) [5,19921] - In file:///android_asset/Resources/sub1/test.js:19,0 12-22 13:33:03.717: E/TiJSError(307): (kroll$2: file:///android_asset/Resources/app.js) [2,19923] - Message: TypeError: Cannot find function testTwo in object [object Object]. (file:///android_asset/Resources/sub1/test.js#19) 12-22 13:33:03.727: E/TiJSError(307): (kroll$2: file:///android_asset/Resources/app.js) [4,19927] - Source: null 12-22 13:33:03.937: I/ARMAssembler(61): generated scanline__00000077:03515104_00000000_00000000 [ 33 ipp] (47 ins) at [0x2f4548:0x2f4604] in 5194000 ns {code} h3.Logs while testing on Simulator with Android 2.3.3 - SDK 1.8.0.1.RC3 (V8 & Rhino) & SDK 1.9.0.v20111219173133 (V8 & Rhino) {code} 12-22 13:47:37.056: D/TiAssetHelper(362): Fetching "sub1/sub2/testTwo.js" with Fastdev... 12-22 13:47:37.205: E/TiJSError(362): (main) [406964,436222] ----- Titanium Javascript Runtime Error ----- 12-22 13:47:37.205: E/TiJSError(362): (main) [0,436222] - In sub1/sub2/testTwo.js:1,17 12-22 13:47:37.205: E/TiJSError(362): (main) [0,436222] - Message: Uncaught ReferenceError: NOT_FOUND is not defined 12-22 13:47:37.205: E/TiJSError(362): (main) [1,436223] - Source: with(sandbox) { NOT_FOUND 12-22 13:47:37.676: E/V8Exception(362): Exception occurred at sub1/sub2/testTwo.js:1: Uncaught ReferenceError: NOT_FOUND is not defined {code} h3.Logs while testing on device: Samsung Galaxy Fit with Android 2.2.1 with SDK 1.8.0.1.RC3 (V8) {code} 12-22 14:10:57.879: V/AudioFlinger(94): MixerThread 0xbb38 TID 151 waking up 12-22 14:10:57.879: V/AudioPolicyManager(94): releaseOutput() 1 12-22 14:10:57.879: V/AudioFlinger(94): remove track (4101) and delete from mixer 12-22 14:10:57.879: V/AudioFlinger(94): PlaybackThread::Track destructor 12-22 14:10:57.899: E/TiAssetHelper(27831): Error while reading asset "Resources/sub1/sub2/testTwo.js": 12-22 14:10:57.899: E/TiAssetHelper(27831): java.io.FileNotFoundException: Resources/sub1/sub2/testTwo.js 12-22 14:10:57.899: E/TiAssetHelper(27831): at android.content.res.AssetManager.openAsset(Native Method) 12-22 14:10:57.899: E/TiAssetHelper(27831): at android.content.res.AssetManager.open(AssetManager.java:313) 12-22 14:10:57.899: E/TiAssetHelper(27831): at android.content.res.AssetManager.open(AssetManager.java:287) 12-22 14:10:57.899: E/TiAssetHelper(27831): at org.appcelerator.kroll.util.KrollAssetHelper.readAsset(KrollAssetHelper.java:55) 12-22 14:10:57.899: E/TiAssetHelper(27831): at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) 12-22 14:10:57.899: E/TiAssetHelper(27831): at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:47) 12-22 14:10:57.899: E/TiAssetHelper(27831): at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:441) 12-22 14:10:57.899: E/TiAssetHelper(27831): at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:602) 12-22 14:10:57.899: E/TiAssetHelper(27831): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:340) 12-22 14:10:57.899: E/TiAssetHelper(27831): at android.os.Handler.dispatchMessage(Handler.java:95) 12-22 14:10:57.899: E/TiAssetHelper(27831): at android.os.Looper.loop(Looper.java:123) 12-22 14:10:57.899: E/TiAssetHelper(27831): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:102) 12-22 14:10:57.909: V/AudioHardwareMSM72XX(94): open driver 12-22 14:10:57.909: V/AudioHardwareMSM72XX(94): get config 12-22 14:10:57.909: V/AudioHardwareMSM72XX(94): set config 12-22 14:10:57.909: V/AudioHardwareMSM72XX(94): buffer_size: 4800 12-22 14:10:57.909: V/AudioHardwareMSM72XX(94): buffer_count: 2 12-22 14:10:57.909: V/AudioHardwareMSM72XX(94): channel_count: 2 12-22 14:10:57.909: V/AudioHardwareMSM72XX(94): sample_rate: 44100 12-22 14:10:57.979: E/TiJSError(27831): (main) [23362,23362] ----- Titanium Javascript Runtime Error ----- 12-22 14:10:57.979: E/TiJSError(27831): (main) [0,23362] - In sub1/test.js:19,39 12-22 14:10:57.979: E/TiJSError(27831): (main) [0,23362] - Message: Uncaught TypeError: Object #<Object> has no method 'testTwo' 12-22 14:10:57.979: E/TiJSError(27831): (main) [0,23362] - Source: var winToOpen = namespace.testTwo(); 12-22 14:10:58.009: I/PowerManagerService(175): Light Animator Finished curIntValue=140 12-22 14:10:58.019: E/V8Exception(27831): Exception occurred at sub1/test.js:19: Uncaught TypeError: Object #<Object> has no method 'testTwo' 12-22 14:10:58.079: W/AudioFlinger(94): write blocked for 167 msecs, 245 delayed writes, thread 0xbb38 12-22 14:10:58.339: V/AudioFlinger(94): getNextBuffer() no more data for track 4100 on thread 0xbb38 {code}

    Appcelerator JIRA | 5 years ago | Karol Pomaski
    org.mozilla.javascript.EcmaError: ReferenceError: "namespace" is not defined. (file:///android_asset/Resources/sub2/testTwo.js#2)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    h3.Problem Global namespace getting lost while separated in a bunch of files stored in different folders. In simulator the result differs from the one from device. h3.Reproducible Steps 1. Run the example project (attached inside JIRA) 2. Press "Click button" h3.Reproducible Code File Structure {code} Resources ¡-sub1 ¡-test.js ¡-sub2 ¡-testTwo.js ¡-app.js {code} test.js {code} (function(){ namespace.test = function(){ var winTest = Titanium.UI.createWindow({ title: 'Test', backgroundColor: '#fff', exitOnClose: true, fullscreen: false // making this a heavy weight window }); var btnButton = Ti.UI.createButton({ title: 'Click button', width: 150, height: 100, top: 100 }); btnButton.addEventListener('click', function(){ Ti.include('sub2/testTwo.js'); var winToOpen = namespace.testTwo(); winToOpen.open(); }); winTest.add(btnButton); namespace.printout(); return winTest; }; })(); {code} testTwo.js {code} (function(){ namespace.testTwo = function(){ var winTestTwo = Titanium.UI.createWindow({ title: 'Test2', backgroundColor: '#fff' }); var btnBack = Ti.UI.createButton({ title: 'back', height: 100, width: 100, top: 50 }); btnBack.addEventListener('click', function(){ winTestTwo.close(); }); winTestTwo.add(btnBack); return winTestTwo; }; })(); {code} app.js {code} //app.js var namespace = {}; Ti.include('sub1/test.js'); namespace.printout = function(){ Ti.API.info('namespace.printout'); }; var win = namespace.test(); win.open(); {code} h3.Logs while testing on Simulator (Android 2.2 & 2.3.3) with SDK 1.7.5 {code} 12-22 13:33:03.388: D/KrollContext(307): (kroll$2: file:///android_asset/Resources/app.js) [17896,19589] Running evaluated script: file:///android_asset/Resources/sub2/testTwo.js 12-22 13:33:03.606: E/KrollContext(307): (kroll$2: file:///android_asset/Resources/app.js) [173,19762] ECMA Error evaluating source: ReferenceError: "namespace" is not defined. (file:///android_asset/Resources/sub2/testTwo.js#2) 12-22 13:33:03.606: E/KrollContext(307): org.mozilla.javascript.EcmaError: ReferenceError: "namespace" is not defined. (file:///android_asset/Resources/sub2/testTwo.js#2) 12-22 13:33:03.606: E/KrollContext(307): at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3784) 12-22 13:33:03.606: E/KrollContext(307): at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3762) 12-22 13:33:03.606: E/KrollContext(307): at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3847) 12-22 13:33:03.606: E/KrollContext(307): at org.mozilla.javascript.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1846) 12-22 13:33:03.606: E/KrollContext(307): at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1785) 12-22 13:33:03.606: E/KrollContext(307): at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1780) 12-22 13:33:03.606: E/KrollContext(307): at script(file:///android_asset/Resources/sub2/testTwo.js:2) 12-22 13:33:03.606: E/KrollContext(307): at script(file:///android_asset/Resources/sub2/testTwo.js:1) 12-22 13:33:03.606: E/KrollContext(307): at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854) 12-22 13:33:03.606: E/KrollContext(307): at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:178) 12-22 13:33:03.606: E/KrollContext(307): at org.mozilla.javascript.Context.evaluateReader(Context.java:1142) 12-22 13:33:03.606: E/KrollContext(307): at org.appcelerator.titanium.kroll.KrollContext$DefaultEvaluator.evaluateFile(KrollContext.java:106) 12-22 13:33:03.606: E/KrollContext(307): at org.appcelerator.titanium.kroll.KrollContext.evaluateScript(KrollContext.java:353) 12-22 13:33:03.606: E/KrollContext(307): at org.appcelerator.titanium.kroll.KrollContext.handleEvalFile(KrollContext.java:382) 12-22 13:33:03.606: E/KrollContext(307): at org.appcelerator.titanium.kroll.KrollContext.evalFile(KrollContext.java:278) 12-22 13:33:03.606: E/KrollContext(307): at org.appcelerator.titanium.kroll.KrollBridge.evalFile(KrollBridge.java:130) 12-22 13:33:03.606: E/KrollContext(307): at org.appcelerator.titanium.TiContext.evalFile(TiContext.java:189) 12-22 13:33:03.606: E/KrollContext(307): at org.appcelerator.titanium.TiContext.evalFile(TiContext.java:209) 12-22 13:33:03.606: E/KrollContext(307): at ti.modules.titanium.TitaniumModule.include(TitaniumModule.java:122) 12-22 13:33:03.606: E/KrollContext(307): at ti.modules.titanium.TitaniumModuleBindingGen$14.invoke(TitaniumModuleBindingGen.java:571) 12-22 13:33:03.606: E/KrollContext(307): at org.appcelerator.kroll.KrollMethod.call(KrollMethod.java:51) 12-22 13:33:03.606: E/KrollContext(307): at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1701) 12-22 13:33:03.606: E/KrollContext(307): at script(file:///android_asset/Resources/sub1/test.js:18) 12-22 13:33:03.606: E/KrollContext(307): at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854) 12-22 13:33:03.606: E/KrollContext(307): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164) 12-22 13:33:03.606: E/KrollContext(307): at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426) 12-22 13:33:03.606: E/KrollContext(307): at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3177) 12-22 13:33:03.606: E/KrollContext(307): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162) 12-22 13:33:03.606: E/KrollContext(307): at org.appcelerator.titanium.kroll.KrollCallback.callSync(KrollCallback.java:139) 12-22 13:33:03.606: E/KrollContext(307): at org.appcelerator.titanium.kroll.KrollCallback$1.run(KrollCallback.java:164) 12-22 13:33:03.606: E/KrollContext(307): at android.os.Handler.handleCallback(Handler.java:587) 12-22 13:33:03.606: E/KrollContext(307): at android.os.Handler.dispatchMessage(Handler.java:92) 12-22 13:33:03.606: E/KrollContext(307): at android.os.Looper.loop(Looper.java:123) 12-22 13:33:03.606: E/KrollContext(307): at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:86) 12-22 13:33:03.606: E/TiJSError(307): (kroll$2: file:///android_asset/Resources/app.js) [45,19807] ----- Titanium Javascript Runtime Error ----- 12-22 13:33:03.606: E/TiJSError(307): (kroll$2: file:///android_asset/Resources/app.js) [5,19812] - In file:///android_asset/Resources/sub2/testTwo.js:2,0 12-22 13:33:03.606: E/TiJSError(307): (kroll$2: file:///android_asset/Resources/app.js) [2,19814] - Message: ReferenceError: "namespace" is not defined. (file:///android_asset/Resources/sub2/testTwo.js#2) 12-22 13:33:03.617: E/TiJSError(307): (kroll$2: file:///android_asset/Resources/app.js) [4,19818] - Source: null 12-22 13:33:03.717: E/KrollCallback(307): (kroll$2: file:///android_asset/Resources/app.js) [91,19909] ECMA Error evaluating source, invocation: [callMethod UI.Button.UI.Button:event:click null], message: TypeError: Cannot find function testTwo in object [object Object]. (file:///android_asset/Resources/sub1/test.js#19) 12-22 13:33:03.717: E/KrollCallback(307): org.mozilla.javascript.EcmaError: TypeError: Cannot find function testTwo in object [object Object]. (file:///android_asset/Resources/sub1/test.js#19) 12-22 13:33:03.717: E/KrollCallback(307): at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3784) 12-22 13:33:03.717: E/KrollCallback(307): at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3762) 12-22 13:33:03.717: E/KrollCallback(307): at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3790) 12-22 13:33:03.717: E/KrollCallback(307): at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3809) 12-22 13:33:03.717: E/KrollCallback(307): at org.mozilla.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3880) 12-22 13:33:03.717: E/KrollCallback(307): at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2359) 12-22 13:33:03.717: E/KrollCallback(307): at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2326) 12-22 13:33:03.717: E/KrollCallback(307): at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1514) 12-22 13:33:03.717: E/KrollCallback(307): at script(file:///android_asset/Resources/sub1/test.js:19) 12-22 13:33:03.717: E/KrollCallback(307): at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854) 12-22 13:33:03.717: E/KrollCallback(307): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164) 12-22 13:33:03.717: E/KrollCallback(307): at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426) 12-22 13:33:03.717: E/KrollCallback(307): at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3177) 12-22 13:33:03.717: E/KrollCallback(307): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162) 12-22 13:33:03.717: E/KrollCallback(307): at org.appcelerator.titanium.kroll.KrollCallback.callSync(KrollCallback.java:139) 12-22 13:33:03.717: E/KrollCallback(307): at org.appcelerator.titanium.kroll.KrollCallback$1.run(KrollCallback.java:164) 12-22 13:33:03.717: E/KrollCallback(307): at android.os.Handler.handleCallback(Handler.java:587) 12-22 13:33:03.717: E/KrollCallback(307): at android.os.Handler.dispatchMessage(Handler.java:92) 12-22 13:33:03.717: E/KrollCallback(307): at android.os.Looper.loop(Looper.java:123) 12-22 13:33:03.717: E/KrollCallback(307): at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:86) 12-22 13:33:03.717: E/TiJSError(307): (kroll$2: file:///android_asset/Resources/app.js) [7,19916] ----- Titanium Javascript Runtime Error ----- 12-22 13:33:03.717: E/TiJSError(307): (kroll$2: file:///android_asset/Resources/app.js) [5,19921] - In file:///android_asset/Resources/sub1/test.js:19,0 12-22 13:33:03.717: E/TiJSError(307): (kroll$2: file:///android_asset/Resources/app.js) [2,19923] - Message: TypeError: Cannot find function testTwo in object [object Object]. (file:///android_asset/Resources/sub1/test.js#19) 12-22 13:33:03.727: E/TiJSError(307): (kroll$2: file:///android_asset/Resources/app.js) [4,19927] - Source: null 12-22 13:33:03.937: I/ARMAssembler(61): generated scanline__00000077:03515104_00000000_00000000 [ 33 ipp] (47 ins) at [0x2f4548:0x2f4604] in 5194000 ns {code} h3.Logs while testing on Simulator with Android 2.3.3 - SDK 1.8.0.1.RC3 (V8 & Rhino) & SDK 1.9.0.v20111219173133 (V8 & Rhino) {code} 12-22 13:47:37.056: D/TiAssetHelper(362): Fetching "sub1/sub2/testTwo.js" with Fastdev... 12-22 13:47:37.205: E/TiJSError(362): (main) [406964,436222] ----- Titanium Javascript Runtime Error ----- 12-22 13:47:37.205: E/TiJSError(362): (main) [0,436222] - In sub1/sub2/testTwo.js:1,17 12-22 13:47:37.205: E/TiJSError(362): (main) [0,436222] - Message: Uncaught ReferenceError: NOT_FOUND is not defined 12-22 13:47:37.205: E/TiJSError(362): (main) [1,436223] - Source: with(sandbox) { NOT_FOUND 12-22 13:47:37.676: E/V8Exception(362): Exception occurred at sub1/sub2/testTwo.js:1: Uncaught ReferenceError: NOT_FOUND is not defined {code} h3.Logs while testing on device: Samsung Galaxy Fit with Android 2.2.1 with SDK 1.8.0.1.RC3 (V8) {code} 12-22 14:10:57.879: V/AudioFlinger(94): MixerThread 0xbb38 TID 151 waking up 12-22 14:10:57.879: V/AudioPolicyManager(94): releaseOutput() 1 12-22 14:10:57.879: V/AudioFlinger(94): remove track (4101) and delete from mixer 12-22 14:10:57.879: V/AudioFlinger(94): PlaybackThread::Track destructor 12-22 14:10:57.899: E/TiAssetHelper(27831): Error while reading asset "Resources/sub1/sub2/testTwo.js": 12-22 14:10:57.899: E/TiAssetHelper(27831): java.io.FileNotFoundException: Resources/sub1/sub2/testTwo.js 12-22 14:10:57.899: E/TiAssetHelper(27831): at android.content.res.AssetManager.openAsset(Native Method) 12-22 14:10:57.899: E/TiAssetHelper(27831): at android.content.res.AssetManager.open(AssetManager.java:313) 12-22 14:10:57.899: E/TiAssetHelper(27831): at android.content.res.AssetManager.open(AssetManager.java:287) 12-22 14:10:57.899: E/TiAssetHelper(27831): at org.appcelerator.kroll.util.KrollAssetHelper.readAsset(KrollAssetHelper.java:55) 12-22 14:10:57.899: E/TiAssetHelper(27831): at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) 12-22 14:10:57.899: E/TiAssetHelper(27831): at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:47) 12-22 14:10:57.899: E/TiAssetHelper(27831): at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:441) 12-22 14:10:57.899: E/TiAssetHelper(27831): at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:602) 12-22 14:10:57.899: E/TiAssetHelper(27831): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:340) 12-22 14:10:57.899: E/TiAssetHelper(27831): at android.os.Handler.dispatchMessage(Handler.java:95) 12-22 14:10:57.899: E/TiAssetHelper(27831): at android.os.Looper.loop(Looper.java:123) 12-22 14:10:57.899: E/TiAssetHelper(27831): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:102) 12-22 14:10:57.909: V/AudioHardwareMSM72XX(94): open driver 12-22 14:10:57.909: V/AudioHardwareMSM72XX(94): get config 12-22 14:10:57.909: V/AudioHardwareMSM72XX(94): set config 12-22 14:10:57.909: V/AudioHardwareMSM72XX(94): buffer_size: 4800 12-22 14:10:57.909: V/AudioHardwareMSM72XX(94): buffer_count: 2 12-22 14:10:57.909: V/AudioHardwareMSM72XX(94): channel_count: 2 12-22 14:10:57.909: V/AudioHardwareMSM72XX(94): sample_rate: 44100 12-22 14:10:57.979: E/TiJSError(27831): (main) [23362,23362] ----- Titanium Javascript Runtime Error ----- 12-22 14:10:57.979: E/TiJSError(27831): (main) [0,23362] - In sub1/test.js:19,39 12-22 14:10:57.979: E/TiJSError(27831): (main) [0,23362] - Message: Uncaught TypeError: Object #<Object> has no method 'testTwo' 12-22 14:10:57.979: E/TiJSError(27831): (main) [0,23362] - Source: var winToOpen = namespace.testTwo(); 12-22 14:10:58.009: I/PowerManagerService(175): Light Animator Finished curIntValue=140 12-22 14:10:58.019: E/V8Exception(27831): Exception occurred at sub1/test.js:19: Uncaught TypeError: Object #<Object> has no method 'testTwo' 12-22 14:10:58.079: W/AudioFlinger(94): write blocked for 167 msecs, 245 delayed writes, thread 0xbb38 12-22 14:10:58.339: V/AudioFlinger(94): getNextBuffer() no more data for track 4100 on thread 0xbb38 {code}

    Appcelerator JIRA | 5 years ago | Karol Pomaski
    org.mozilla.javascript.EcmaError: ReferenceError: "namespace" is not defined. (file:///android_asset/Resources/sub2/testTwo.js#2)
  6. 0

    --define throws error if value is `undefined`

    GitHub | 2 years ago | dantman
    org.mozilla.javascript.EcmaError: TypeError: Impossible de lire la propriété "undeclared" de undefined (scope.js#304)

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.mozilla.javascript.EcmaError

      ReferenceError: "detailWindow" is not defined. (app://ui.js#1(eval)#1)

      at org.mozilla.javascript.ScriptRuntime.constructError()
    2. Rhino
      Interpreter.interpretLoop
      1. org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3784)
      2. org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3762)
      3. org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3847)
      4. org.mozilla.javascript.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1846)
      5. org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1785)
      6. org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1780)
      6 frames