{ "id": "128273", "key": "TIMOB-16788", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "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": [], "resolution": null, "resolutiondate": null, "created": "2014-03-27T10:53:31.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "android", "parity", "webview" ], "versions": [ { "id": "15857", "description": "Release 3.2.2", "name": "Release 3.2.2", "archived": false, "released": true, "releaseDate": "2014-03-09" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:03:57.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "attachment": [ { "id": "46898", "filename": "device-2014-03-27-115312.png", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-03-27T10:53:32.000+0000", "size": 48156, "mimeType": "image/png" }, { "id": "46897", "filename": "iOS-simulatorschermafbeelding 27 mrt. 2014 11.52.46.png", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-03-27T10:53:32.000+0000", "size": 68433, "mimeType": "image/png" }, { "id": "46896", "filename": "wvr.zip", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-03-27T10:53:32.000+0000", "size": 260368, "mimeType": "application/zip" } ], "flagged": false, "summary": "Android: WebView cannot find assets in ApplicationData directory", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "SDK 3.2.2.GA\r\nCLI 3.2.1.GA\r\nAndroid 4.1 on Samsung Galaxy S2\r\niOS 7.1 on iOS Simulator", "comment": { "comments": [ { "id": "298950", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "A terrible, but functioning workaround is to copy the web-app to the resource directory *after* Alloy and the Titanium CLI are done with compiling, but before packaging:\r\n\r\n{code}\r\nexports.cliVersion = '>=3.2';\r\n\r\nvar path = require(\"path\"),\r\n wrench = require('wrench');\r\n\r\nexports.init = function(logger, config, cli, appc) {\r\n\r\n if (cli.argv.platform !== 'android') {\r\n\r\n cli.addHook('build.post.compile', function(build, finished) {\r\n\r\n logger.log(\"======= COPYING 'WWWW' =======\");\r\n\r\n var source = path.join(build.projectDir, \"www\");\r\n var destination = path.join(build.xcodeAppDir, \"www\");\r\n\r\n wrench.copyDirSyncRecursive(source, destination, {\r\n forceDelete: true,\r\n preserveFiles: false\r\n });\r\n\r\n finished();\r\n });\r\n\r\n } else {\r\n\r\n cli.addHook('build.android.writeAndroidManifest', function(opts, finished) {\r\n\r\n logger.log(\"======= COPYING 'WWWW' =======\");\r\n\r\n var source = path.join(opts.ctx.projectDir, \"www\");\r\n var destination = path.join(opts.ctx.buildDir, \"bin\", \"assets\", \"Resources\", \"www\");\r\n\r\n wrench.copyDirSyncRecursive(source, destination, {\r\n forceDelete: true,\r\n preserveFiles: false\r\n });\r\n\r\n finished();\r\n });\r\n\r\n }\r\n};\r\n{code}", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-03-27T12:51:24.000+0000", "updated": "2014-03-27T13:13:25.000+0000" }, { "id": "299291", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Moving this ticket to engineering as I can reproduce the issue with the provided test case.", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-03-31T05:04:12.000+0000", "updated": "2014-03-31T05:04:12.000+0000" }, { "id": "302883", "author": { "name": "emiliorodriguez@gmail.com", "key": "emiliorodriguez@gmail.com", "displayName": "Emilio Rodriguez", "active": true, "timeZone": "America/Los_Angeles" }, "body": "A better workaround we just came across is using *Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory).getNativePath()* when building the webView url instead of using only *Ti.Filesystem.applicationDataDirectory*\r\n\r\nIt works but still, a proper fix would be nice.", "updateAuthor": { "name": "emiliorodriguez@gmail.com", "key": "emiliorodriguez@gmail.com", "displayName": "Emilio Rodriguez", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-04-29T15:26:22.000+0000", "updated": "2014-04-29T15:27:19.000+0000" }, { "id": "388915", "author": { "name": "michielve", "key": "michielve", "displayName": "Michiel van Eerd", "active": true, "timeZone": "Europe/Berlin" }, "body": "I used the approach of Fokke and it works for development and app store builds for iOS, but fails when doing an ad-hoc build as you get the error:\r\n\r\n{{Failed to verify code signature of /some/path/myapp.app : 0xe8008017 (A signed resource has been added, modified, or deleted.)}}\r\n\r\nI guess it is because you add something to the build after some signing has been done. If someone knows a workaround for this, I'll be glad to hear!", "updateAuthor": { "name": "michielve", "key": "michielve", "displayName": "Michiel van Eerd", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-06-23T09:09:30.000+0000", "updated": "2016-06-23T09:09:30.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }