{
"id": "111183",
"key": "TIMOB-13065",
"fields": {
"issuetype": {
"id": "2",
"description": "A new feature of the product, which has yet to be developed.",
"name": "New Feature",
"subtask": false
},
"project": {
"id": "10153",
"key": "TIMOB",
"name": "Titanium SDK/CLI",
"projectCategory": {
"id": "10100",
"description": "Titanium and related SDKs used in application development",
"name": "Client"
}
},
"fixVersions": [
{
"id": "15703",
"description": "2013 Sprint 22",
"name": "2013 Sprint 22",
"archived": true,
"released": true,
"releaseDate": "2013-11-01"
},
{
"id": "15704",
"description": "2013 Sprint 22 API",
"name": "2013 Sprint 22 API",
"archived": true,
"released": true,
"releaseDate": "2013-11-01"
},
{
"id": "14982",
"description": "Release 3.2.0",
"name": "Release 3.2.0",
"archived": false,
"released": true,
"releaseDate": "2013-12-19"
}
],
"resolution": {
"id": "1",
"description": "A fix for this issue is checked into the tree and tested.",
"name": "Fixed"
},
"resolutiondate": "2013-10-28T18:38:06.000+0000",
"created": "2013-03-14T00:07:03.000+0000",
"priority": {
"name": "High",
"id": "2"
},
"labels": [
"android",
"jellybean",
"module_android",
"qe-testadded",
"triage",
"webView"
],
"versions": [],
"issuelinks": [],
"assignee": {
"name": "pwang",
"key": "pwang",
"displayName": "Ping Wang",
"active": true,
"timeZone": "America/Los_Angeles"
},
"updated": "2015-07-28T14:06:34.000+0000",
"status": {
"description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.",
"name": "Closed",
"id": "6",
"statusCategory": {
"id": 3,
"key": "done",
"colorName": "green",
"name": "Done"
}
},
"components": [
{
"id": "10202",
"name": "Android",
"description": "Android Platform"
}
],
"description": "h2. Problem description\r\n\r\nStarting in API level 16 (Jellybean and above), Android is by default more restrictive in the web settings. See this link:\r\n\r\n [http://developer.android.com/reference/android/webkit/WebSettings.html#setAllowUniversalAccessFromFileURLs(boolean)]\r\n\r\nIt prevents XHR requests from being made from local files. Titanium must allow setting this flag in Web View settings, or lots of WebView functionality will be wiped out.\r\n\r\nPlease enable setting this flag for Android web views ASAP, thanks. Obviously, this is an issue only when setting targetSdkVersion=\"16\" or higher.\r\n\r\nh2. Additional information\r\nhttp://stackoverflow.com/questions/11318703/access-control-allow-origin-error-at-android-4-1\r\n",
"attachment": [],
"flagged": false,
"summary": "Android: API 16 breaks remote web services from local files",
"creator": {
"name": "mokesmokes",
"key": "mokesmokes",
"displayName": "Mark Mokryn",
"active": true,
"timeZone": "Asia/Jerusalem"
},
"subtasks": [],
"reporter": {
"name": "mokesmokes",
"key": "mokesmokes",
"displayName": "Mark Mokryn",
"active": true,
"timeZone": "Asia/Jerusalem"
},
"environment": "Titanium Mobile API Level 16 (Jellybean), all Titanium versions",
"comment": {
"comments": [
{
"id": "242190",
"author": {
"name": "mokesmokes",
"key": "mokesmokes",
"displayName": "Mark Mokryn",
"active": true,
"timeZone": "Asia/Jerusalem"
},
"body": "Edited original - I previously referenced the wrong Android flag. The link above is now correct, the flag is setAllowUniversalAccessFromFileURLs. Thanks",
"updateAuthor": {
"name": "mokesmokes",
"key": "mokesmokes",
"displayName": "Mark Mokryn",
"active": true,
"timeZone": "Asia/Jerusalem"
},
"created": "2013-03-14T08:13:31.000+0000",
"updated": "2013-03-14T08:13:31.000+0000"
},
{
"id": "242253",
"author": {
"name": "dcassenti",
"key": "dcassenti",
"displayName": "Davide Cassenti",
"active": true,
"timeZone": "Europe/Berlin"
},
"body": "This seems to be a problem only on device; Emulator looks to work even if 4.1.x",
"updateAuthor": {
"name": "dcassenti",
"key": "dcassenti",
"displayName": "Davide Cassenti",
"active": true,
"timeZone": "Europe/Berlin"
},
"created": "2013-03-14T16:22:58.000+0000",
"updated": "2013-03-14T16:22:58.000+0000"
},
{
"id": "242273",
"author": {
"name": "mokesmokes",
"key": "mokesmokes",
"displayName": "Mark Mokryn",
"active": true,
"timeZone": "Asia/Jerusalem"
},
"body": "@Davide - I did not try on emulator, but I did spend a few hours debugging why all of a sudden I'm getting null origin errors from my AJAX calls.... For now, my workaround is to set targetSdkVersion=\"14\", but clearly this flag must be a new option in WebView configuration.",
"updateAuthor": {
"name": "mokesmokes",
"key": "mokesmokes",
"displayName": "Mark Mokryn",
"active": true,
"timeZone": "Asia/Jerusalem"
},
"created": "2013-03-14T17:38:57.000+0000",
"updated": "2013-03-14T17:38:57.000+0000"
},
{
"id": "260946",
"author": {
"name": "mokesmokes",
"key": "mokesmokes",
"displayName": "Mark Mokryn",
"active": true,
"timeZone": "Asia/Jerusalem"
},
"body": "submitted PR: https://github.com/appcelerator/titanium_mobile/pull/4438",
"updateAuthor": {
"name": "mokesmokes",
"key": "mokesmokes",
"displayName": "Mark Mokryn",
"active": true,
"timeZone": "Asia/Jerusalem"
},
"created": "2013-07-08T11:36:40.000+0000",
"updated": "2013-07-08T11:36:40.000+0000"
},
{
"id": "271891",
"author": {
"name": "mokesmokes",
"key": "mokesmokes",
"displayName": "Mark Mokryn",
"active": true,
"timeZone": "Asia/Jerusalem"
},
"body": "The pull request (just 3 lines of code!) has been working for me in production for quite some time now, battle tested on Android versions from 10 through 18, please commit it to enable web APIs from local webview files on Jellybean.",
"updateAuthor": {
"name": "mokesmokes",
"key": "mokesmokes",
"displayName": "Mark Mokryn",
"active": true,
"timeZone": "Asia/Jerusalem"
},
"created": "2013-09-19T06:30:30.000+0000",
"updated": "2013-09-19T06:30:30.000+0000"
},
{
"id": "276626",
"author": {
"name": "pwang",
"key": "pwang",
"displayName": "Ping Wang",
"active": true,
"timeZone": "America/Los_Angeles"
},
"body": "[~mokesmokes], I left some comments on your PR in github. Can you update your PR and provide a test case? Thanks.",
"updateAuthor": {
"name": "pwang",
"key": "pwang",
"displayName": "Ping Wang",
"active": true,
"timeZone": "America/Los_Angeles"
},
"created": "2013-10-24T17:37:47.000+0000",
"updated": "2013-10-24T17:37:47.000+0000"
},
{
"id": "276634",
"author": {
"name": "mokesmokes",
"key": "mokesmokes",
"displayName": "Mark Mokryn",
"active": true,
"timeZone": "Asia/Jerusalem"
},
"body": "OK, I'll do it over the weekend.",
"updateAuthor": {
"name": "mokesmokes",
"key": "mokesmokes",
"displayName": "Mark Mokryn",
"active": true,
"timeZone": "Asia/Jerusalem"
},
"created": "2013-10-24T18:02:12.000+0000",
"updated": "2013-10-24T18:02:12.000+0000"
},
{
"id": "276773",
"author": {
"name": "mokesmokes",
"key": "mokesmokes",
"displayName": "Mark Mokryn",
"active": true,
"timeZone": "Asia/Jerusalem"
},
"body": "Here is a test case that demonstrates the problem and fix. Note I tested this on 3.1.x, not 3.2.0 since I couldn't get the 3.2.0 CLI to work, and I can't mess too much with my production environment - so please check. Without the fix, this test case will work on iOS and Android devices < API 16, and will fail API >= 16. With the fix it works on all. I will submit a new PR for 3.2.0.\r\n\r\n1. Make sure to build for Jelly Bean, e.g. in tiapp.xml:\r\n{code}\r\n