[TIMOB-7252] Android: Rhino apps print thousands of VFY logcat messages when backed-out of
GitHub Issue | n/a |
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Won't Fix |
Resolution Date | 2013-08-01T21:00:15.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Sprint 2012-03, Release 1.8.2 |
Components | Android |
Labels | module_build, qe-ios11612, qe-nfc, qe-testadded |
Reporter | Wilson Luu |
Assignee | Bill Dawson |
Created | 2012-01-16T15:25:27.000+0000 |
Updated | 2017-03-20T20:32:02.000+0000 |
Description
Fail Case / Test Case
* Create any Titanium app (does not need to be based on a template).
* Select Rhino as the runtime.
* Enable debug logcat messages by adding <property type="bool" name="ti.android.debug">true</property>
to tiapp.xml.
* Launch the app to emulator or device, it does not matter.
* Back out of the app.
* Check the logcat. In the fail case, you'll see a ton (literally thousands?) of "VFY" related messages have scrolled by. When testing the fix, you should not see these, but you should see some "dispose()" messages (those messages only appear if ti.android.debug is set to true).
--- ORIG DETAILS FOLLOW ---
Details: After creating a tabbed template and installing to an Android device, unexpected messages appear in the logcat after exiting the app.
Steps to reproduce:
1. Create a Tabbed Application using the project template wizard
2. Make sure runtime is set to Rhino
3. Install to an Android device
4. After app is launched, press the back button
Actual: Unexpected Warning, Debug, and Error messages appear in the logcat. See attachment.
Expected: Unexpected messages should not appear.
Note: To repeatedly reproduce bug on the same device, Force Stop the app and relaunch.
Attachments
File | Date | Size |
log.txt | 2012-01-16T15:25:27.000+0000 | 68886 |
This bug seems to occur for Single Window Template and Master/Detail Template as well.
This will be a platform issue - the mobile SDK is looking for modules that should not be included in the build. All the usual suspects for "unneeded" modules are there - Contacts, Facebook, etc. - none of them are used in the templates. The fix for this will likely be in the logic which deals with these "optional" modules.
Neeraj...appears to be a Mobile platform issue. Assigning to you so you so you can decide how you'd like to proceed.
Doesn't happen on OSX with Studio 1.0.8.201201262211 and production 1.8.1 mobile sdk. Trying Ubuntu ...
Sorry, misspoke: I had forgotten to switch to Rhino. It *does* happen with production 1.8.1. Still investigating.
Problem Description
Our generated KrollGeneratedBindings.java keeps a hash of all proxy prototype classes in the Android Titanium Mobile SDK. When the runtime shuts down (i.e., backing out of the app), we run through all those prototype classes and call their staticdispose
methods. For many of those prototypes, the calling of the staticdispose
will be the first time the prototype class is used. For example, if you're _not_ using the Facebook module in your app, then when we callti.modules.titanium.facebook.FacebookModulePrototype.dispose()
, the FacebookModulePrototype will be loaded by the class loader for the very first time. And since you're not using Facebook in your app, the Facebook module itself is not even packaged in the application. Therefore once dispose() is called the class loader will show all these VFY errors because the FacebookModulePrototype class refers to the FacebookModule class, which doesn't exist.Solution Description
The solution I came up with is to keep aSet
of prototypes that are actually used (instantiated) during the lifetime of the application, then when it's time to dispose (when the runtime shuts down), just calldispose
on those prototype classes.Pull request ready https://github.com/appcelerator/titanium_mobile/pull/1324
Closing issue: Tested with Ti Studio Build 1.0.8.201201262211 Ti Mobile SDK 1.9.0.v20120206101634 OSX Lion Android emulator 2.2, Droid 3 Expected behavior is shown
VFY logcat messages appears for V8 and Rhino. OS: Mountain Lion OSX 10.8.2 Titanium Studio, build: 3.0.0.201210172118 Titanium SDK: 3.0.0.v20121017192538 10-18 16:32:16.316: W/dalvikvm(1032): VFY: unable to resolve new-instance 169 (Landroid/os/StrictMode$ThreadPolicy$Builder;) in Lorg/appcelerator/kroll/common/TiFastDev; 10-18 16:32:16.326: D/dalvikvm(1032): VFY: replacing opcode 0x22 at 0x0016 10-18 16:32:16.326: D/dalvikvm(1032): VFY: dead code 0x0018-0025 in Lorg/appcelerator/kroll/common/TiFastDev;.