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'
+1. Happening for me too. Same behavior.
Potential workaround: http://billdawson.com/overcoming-timob-13079-in-titanium-android-modules
Closing ticket as duplicate.