Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15764] IOS Webview using setHTML shows an ERROR 'Couldn't determine the proper encoding.' at closing

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2013-12-23T19:25:00.000+0000
Affected Version/sRelease 3.1.3
Fix Version/sn/a
ComponentsiOS
LabelsSupportTeam
ReporterNico de Groot
AssigneeIngo Muschenetz
Created2013-11-06T22:14:39.000+0000
Updated2017-03-22T21:16:03.000+0000

Description

Problem Description

When a webview is closed which was filled by using setHTML, it shows errors in the console

Test case

 
webview = Ti.UI.createWebView();
	self.add(webview);

	self.showArticle = function(html) {
		webview.setHtml("<p>hi</p>");

        };

Extra info (error message)

[ERROR] Couldn't determine the proper encoding. Make sure this file: LucepediAPP.app is UTF-8 encoded. [ERROR] Error loading file: /Users/ncdegroot/Library/Application Support/iPhone Simulator/6.1/Applications/F751D4EE-E3B7-4823-B3F3-F8A76ED38238/LucepediAPP.app. Message was: Error Domain=NSCocoaErrorDomain Code=257 "The operation couldn’t be completed. (Cocoa error 257.)" UserInfo=0xae690e0 {NSFilePath=/Users/ncdegroot/Library/Application Support/iPhone Simulator/6.1/Applications/F751D4EE-E3B7-4823-B3F3-F8A76ED38238/LucepediAPP.app, NSUnderlyingError=0xae69140 "The operation couldn’t be completed. Permission deni

Comments

  1. Mauro Parra-Miranda 2013-11-21

    Hello, as additional comment, we have seen this bug with other customers' environments. Best, Mauro
  2. Nico de Groot 2013-12-21

    The error occurs after the first close of the window (back button). After a code review and retesting I discovered the cause. Closing the window prevents reopening the webview error free because the containing window has to be created again. In my case the webview was recreated on reopening, but not the containing window. By moving
    createWindow()
    inside the eventlistener that opens the window, the error disappears.
       item_container_window = Ti.UI.createWindow();
       ...
       newsview.addEventListener('itemSelected', function(e) {
       	item_container_window = Ti.UI.createWindow();
       	itemview = new ItemView("news");
       	item_container_window.add(itemview);
       
       	itemview.showArticle(e.link); 
       	win.tab.open(item_container_window);
       });
       
       newsview.addEventListener('itemSelected', function(e) {
       	item_container_window = Ti.UI.createWindow();
       	itemview = new ItemView("news");
       	item_container_window.add(itemview);
       
       	itemview.showArticle(e.link); 
       	win.tab.open(item_container_window);
       });
       
    I think this issues can be marked as resolved, programmer error after all.
  3. Ingo Muschenetz 2013-12-23

    Resolving as invalid based on customer feedback.
  4. Lee Morris 2017-03-22

    Closing ticket as invalid with reference to the above comments.

JSON Source