[TIMOB-25242] Android: V8Exception on launch
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | None |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-11-15T22:27:12.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 7.0.0 |
Components | Android |
Labels | n/a |
Reporter | Shuo Liang |
Assignee | Gary Mathews |
Created | 2017-09-07T01:19:35.000+0000 |
Updated | 2017-11-16T00:10:41.000+0000 |
Description
Customer is facing to the following problem.
Sometimes our app hangs when launched on android. It doesn't happen every time, but sometimes it will happen fairly frequently on a given device (as much as 30-40% of the time).
It appears that this exception is to blame
09-01 14:29:06.650 5042 5042 E TiExceptionHandler: (main) [21,21] ----- Titanium Javascript Runtime Error -----
09-01 14:29:06.650 5042 5042 E TiExceptionHandler: (main) [0,21] - In ti:/module.js:622,21
09-01 14:29:06.650 5042 5042 E TiExceptionHandler: (main) [0,21] - Message: Uncaught TypeError: Cannot use 'in' operator to search for 'Resources/TitanUp/TitanUp' in null
09-01 14:29:06.650 5042 5042 E TiExceptionHandler: (main) [0,21] - Source: return filename in fileIndex;
09-01 14:29:06.651 5042 5063 E V8Exception: Exception occurred at ti:/module.js:622: Uncaught TypeError: Cannot use 'in' operator to search for 'Resources/TitanUp/TitanUp' in null
09-01 14:29:06.675 2366 2377 D InputDispatcher: Focus entered window: 5042
(TitanUp is a commonjs module belong to customer)
Attached is the full adb log for the process in question.
And customer believe that is probably a bug inside the Titanium runtime.
Customer also complain that "How could our Javascript trigger an exception like this so early in the application's life cycle? It looks like a problem *resolving* the path to our library, which suggests that it is inside the Titanium runtime."
Please advise.
Attachments
File | Date | Size |
---|---|---|
log-bad-proc.txt | 2017-09-07T01:18:40.000+0000 | 9035 |
master: https://github.com/appcelerator/titanium_mobile/pull/9422
Any update on this? I see there is PR. Will this fix the problem, Which version will be expected about this fix.
[~gmathews] So the full log shows the real root cause. That failure to load the JS file via require is actually a symptom here, not the root cause of the issue. Look at lines 2 and 5 here:
So the real issue here is that we're hitting this: https://github.com/appcelerator/titanium_mobile/blob/master/android/runtime/common/src/java/org/appcelerator/kroll/util/KrollAssetHelper.java#L57 It looks like
KrollAssetHelper.init()
is getting called too late, which is called viaKrollRuntime.init()
, which is called during the app'sonCreate()
lifecycle callback. My best guess here is that we should be moving that init call up higher in that method: https://github.com/appcelerator/titanium_mobile/blob/master/android/templates/build/App.java#L48I'm experiencing this issue as well, SDK 6.2.2 Android 7.0 and 8.0
Any update on this?
Any update?
Then exitOnClose set true, after close main window on Oreo.
And other situation on Oreo.
And this error on Nougat.
[~engross] Thanks for the feedback, the
AssetManager
issue is solved by TIMOB-25324.FR Passed. Waiting for merge to get enabled.
PR Merged.
Verified the fix in SDK 7.0.0.v20171115153702. Closing.