[AC-5198] baseUrl not working: Android Marshmallow and Oreo
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Needs more info |
Resolution Date | 2017-11-03T20:38:50.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | 6.2.2, Android, baseurl, webview |
Reporter | ios.admin@investis.com |
Assignee | Shak Hossain |
Created | 2017-09-15T05:19:27.000+0000 |
Updated | 2019-02-24T13:04:23.000+0000 |
Description
*+{color:red}baseURL{color}+* property is not working in android application. As a result of it, my application is unable to render/ show styles and images stored at local paths.
Thank you for reporting the two issues! Like for the other one, please provide a reproducible test-case and error-logs first, thank you!
While accessing the Webpage in android webview, all the external resources linked in html page, won't able to load in webview. Used baseUrl with setHTML method as below: $.webView.setHtml(htmlContent, { baseURL : path + "/" }); And in console it gives following errors: [ERROR] :AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/jquery.js [ERROR] : AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/Resources/images/banner.jpg
Any Update on above?
The test-case provided won't help to reproduce the issue, you will need to provide a test-case that can be dropped into a project, including your assets. If you can, just upload a test-project and we come back to you asap.
Hello, Please provide a sample code that can be dropped into a project, including your assets. If you can, just upload a test-project and we come back to you asap. Or else we will be closing this ticket. Thanks.
I've confirmed that the
WebView.setHtml()
method's 2nd argument is being ignored on Android as of Titanium 6.1.0. This changed happened in the link below. I think there was confusion at the time on whether or not it was an officially documented feature. https://github.com/appcelerator/titanium_mobile/pull/8854 But I agree, the "baseURL" setting is definitely needed on both Android and iOS. Especially when using an iframe, such as an embedded YouTube video. The below can reproduce this issue.This issue was written up here: [TIMOB-26848]