Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13097] Android: In custom module when addEventListener is called on proxy object in app.js gives Uncaught TypeError: Object #<Test> has no method 'addEventListener'

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionDuplicate
Resolution Date2013-05-07T21:07:01.000+0000
Affected Version/sRelease 3.0.0, Release 3.0.2
Fix Version/s2013 Sprint 10 Core, 2013 Sprint 10, Release 3.2.0
ComponentsAndroid
Labelsexalture, supportTeam
ReporterRupesh Sharma
AssigneeAllen Yeung
Created2013-03-18T12:57:01.000+0000
Updated2017-03-20T16:26:29.000+0000

Description

Description

In custom module there is one method that returns an object of a class that inherits from KrollProxy. In app.js when addEventListener is called on this proxy object it works fine for multiple times but when back button is clicked that leads to homepage and if again application is launched at this time it gives following error :
E/V8Exception(30249): Exception occurred at app.js:26: Uncaught TypeError: Object #<Test> has no method 'addEventListener'
Note:In this case no annotation is used on class that inherits from krollproxy (@Kroll.proxy(creatableInModule=SampleModule.class)) While, in other case when the above annotation is used on class inherited from krollproxy (ExampleProxy) and proxy object is created using createExample in "app.js" it works fine.

TestCase

1. Please find the attached "ReproducibleTestCase.zip" having custom module and application projects. 2. Import both the projects in Titanium studio and install the module into the application. 3. Install the application and run. 4. Click the button (It will create a custom object using the module, and attach an event listener to it). 5. Press back button of device and again open application and press button this time it will give the following error:
E/V8Exception(30249): Exception occurred at app.js:26: Uncaught TypeError: Object #<Test> has no method 'addEventListener'

Attachments

FileDateSize
ReproducibleTestCase.zip2013-03-18T12:58:28.000+0000826102

Comments

  1. Bill Dawson 2013-03-27

    +1. Happening for me too. Same behavior.
  2. Bill Dawson 2013-03-29

    Potential workaround: http://billdawson.com/overcoming-timob-13079-in-titanium-android-modules
  3. Allen Yeung 2013-05-07

  4. Lee Morris 2017-03-20

    Closing ticket as duplicate.

JSON Source