[AC-732] Android : since 3.2.1 javascript file not loaded in webview on device
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Cannot Reproduce |
Resolution Date | 2014-05-04T06:12:40.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | n/a |
Reporter | Adrien NEVEU |
Assignee | Ritu Agrawal |
Created | 2014-04-17T13:06:03.000+0000 |
Updated | 2016-03-08T07:36:59.000+0000 |
Description
*Only on my device :* Since SDK 3.2.2 (perhaps since 3.2.1) when I am trying to load a js ressource on an html page loaded by a webview, I am getting the following error in the log:
{noformat} [INFO] : I/TiWebChromeClient.console: (main) [50399,84113] Uncaught ReferenceError: Dygraph is not defined (107:file:///android_asset/Resources/graphe/graphe.html) {noformat}
+It is working well with the SDK 3.2.0 on my device+ and it is working for all other emulators with all SDK
This is the way I load the js file in my html file :
<html>
<head>
<script type="text/javascript" src="dygraph-combined.js"></script>
</head>
<body>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<div id="graphdiv" > </div>
<script>
var g = null;
var Ti = window.parent.Ti;
g = new Dygraph(document.getElementById("graphdiv"),"Date,Data\n"
+"2014-01-20,50\n" +
"2014-01-22,51\n" +
"2014-02-10,53\n",
{interactionModel:{}});
....
Please provide a simple and fully functional test case to reproduce this issue.
I have found why the application could not load javascript file in the webview: When I am using Titanium Studio to *Run on device*, the JS file next to the HTML file is not copied to the Ressources directory (in the build directory). But when it is *Run on the emulator* the JS file is copied. This bug seems to be there since SDK 3.2.1
It appears related to TIMOB-16607 but it is strange that you are running into this issue only on device and not on simulator. Can you please provide a simple runnable project to reproduce this issue and we would look at it a priority?
Resolving this issue as I cannot reproduce it and the reporter has not provided the requested test case. Would be happy to reopen this ticket once we have the requested information available.