{ "id": "111248", "key": "TIMOB-13075", "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": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2016-08-29T19:16:18.000+0000", "created": "2013-03-15T13:14:40.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "exalture", "supportTeam" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" }, { "id": "14164", "description": "Release 3.0.2", "name": "Release 3.0.2", "archived": true, "released": true, "releaseDate": "2013-02-19" } ], "issuelinks": [ { "id": "35265", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "102290", "key": "TIMOB-12591", "fields": { "summary": "Titanium Studio does not copy contents of /platform/android/assets folder to /build/android/bin/assets folder", "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" } }, "priority": { "name": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-24T21:53:00.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. Description\r\nIn a custom android module having images in assets directory in which getting any image in Kroll.method using \"context.getAssets().open(\"sample.jpg\");\" when installed to any blank android project it runs perfectly for the first time after cleaning it but again if try to install without cleaning it will not be able to find the file this time.\r\n\r\nh2. Steps to Reproduce\r\n1. Create a Titanium Module Project and put any image in assets directory.\r\n2. In \"example\" @Kroll.method put this code :\r\n{code}\r\ntry {\r\n InputStream is = context.getAssets().open(\"sample.jpg\");\r\n Log.d(LCAT, \"inputstream==\"+is);\r\n} catch (IOException e) {\r\n e.printStackTrace();\r\n}\r\n{code}\r\n3. Install this module in Titanium android project.\r\n4. Clean the project and then install and run it.(It will run successfully this time)\r\n5. Now install the project again without cleaning it first, and run it again.(This time it will not be able to find the file)\r\n\r\nh2. Error Logs\r\n{code}\r\njava.io.FileNotFoundException: sample.jpg\r\nW/System.err( 957): at android.content.res.AssetManager.openAsset(Native Method)\r\nW/System.err( 957): at android.content.res.AssetManager.open(AssetManager.java:315)\r\nW/System.err( 957): at android.content.res.AssetManager.open(AssetManager.java:289)\r\nW/System.err( 957): at ti.gl.imagemod.SampleimagemodModule.example(SampleimagemodModule.java:55)\r\nW/System.err( 957): at org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method)\r\nW/System.err( 957): at org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:140)\r\nW/System.err( 957): at org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:289)\r\nW/System.err( 957): at org.appcelerator.kroll.runtime.v8.V8Runtime.handleMessage(V8Runtime.java:166)\r\nW/System.err( 957): at android.os.Handler.dispatchMessage(Handler.java:95)\r\nW/System.err( 957): at android.os.Looper.loop(Looper.java:137)\r\nW/System.err( 957): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112)\r\n{code}", "attachment": [], "flagged": false, "summary": "Android:Module having images in assets folder installed in android application does not copy over assets during second build", "creator": { "name": "rsharma", "key": "rsharma", "displayName": "Rupesh Sharma", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "rsharma", "key": "rsharma", "displayName": "Rupesh Sharma", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Android : 4.0.4\r\nTi Studio : 3.0.2.201302191606", "comment": { "comments": [ { "id": "264634", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "Is this a emulator or device build?\n\nIs there a test project that demonstrates the problem?", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2013-08-02T01:15:54.000+0000", "updated": "2013-08-02T01:15:54.000+0000" }, { "id": "264662", "author": { "name": "rsharma", "key": "rsharma", "displayName": "Rupesh Sharma", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Chris,\nTested on device.", "updateAuthor": { "name": "rsharma", "key": "rsharma", "displayName": "Rupesh Sharma", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-02T11:10:41.000+0000", "updated": "2013-08-02T11:10:41.000+0000" }, { "id": "394675", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "Unable to reproduce with Titanium SDK 5.5.0.\r\n\r\nNote that the steps to reproduce have changed. Now you must add the following imports:\r\n\r\n{code}\r\nimport java.io.InputStream;\r\nimport java.io.IOException;\r\nimport android.content.Context;\r\n{code}\r\n\r\nand then change the test code inside your KrollModule implementation:\r\n\r\n{code}\r\n@Kroll.method\r\npublic String example()\r\n{\r\n\tLog.d(LCAT, \"example called\");\r\n\r\n\ttry {\r\n\t\tContext context = TiApplication.getInstance();\r\n\t\tInputStream is = context.getAssets().open(\"test-asset.png\");\r\n\t\tLog.d(LCAT, \"inputstream==\"+is);\r\n\t} catch (IOException e) {\r\n\t\te.printStackTrace();\r\n\t}\r\n\r\n\treturn \"hello world\";\r\n}\r\n{code}\r\n\r\nWhen testing, I see:\r\n\r\n{code}\r\n[DEBUG] MymoduleModule: (main) [1,1431] inputstream==android.content.res.AssetManager$AssetInputStream@8edbfc7\r\n{code}", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2016-08-29T19:16:18.000+0000", "updated": "2016-08-29T19:16:18.000+0000" }, { "id": "415800", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as the issue cannot be reproduced.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-24T21:53:00.000+0000", "updated": "2017-03-24T21:53:00.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }