[TIMOB-15896] WebView's evalJS method times out on Android API >= 17
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2014-09-07T22:06:30.000+0000 |
Affected Version/s | Release 3.2.0 |
Fix Version/s | Release 3.4.0 |
Components | Android |
Labels | android, defect, evaljs, javascript, webview |
Reporter | Nuno Sousa |
Assignee | Ingo Muschenetz |
Created | 2013-11-27T15:09:20.000+0000 |
Updated | 2017-03-22T23:10:10.000+0000 |
Description
Since API 17, any WebView that intends to expose a Javascript object must decorate methods with the @JavascriptInterface annotation, as described [here](http://developer.android.com/guide/webapps/webview.html).
The [TiReturn class](https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/src/java/ti/modules/titanium/ui/widget/webview/TiWebViewBinding.java#L174) does not use this annotation which is why I believe that any evalJS call simply returns null and outputs:
bq. W/TiWebViewBinding( 3268): (KrollRuntimeThread) Timeout waiting to evaluate JS
Tested this issue with code below and reproduced the error.
Testing Environment:
OS: MAC OS X 10.8.5 Ti SDK: 3.1.3 GA ,3.2.0.x Ti CLI: 3.3.0 Android Device 4.2.2 Android SDK 4.4Test Code
pass.html
Logs
Thanks
Is this still on the radar? The issue still exists in SDK 3.3.0.GA.
Has anyone tried adding the appropriate annotation to the class noted to see if that resolves the issue for them?
Resolving as duplicate of linked issue.
Closing ticket as duplicate as the relevant ticket is linked above.