{ "id": "102290", "key": "TIMOB-12591", "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": [ { "id": "15419", "description": "2013 Sprint 09 Core", "name": "2013 Sprint 09 Core", "archived": true, "released": true, "releaseDate": "2013-05-06" }, { "id": "15107", "description": "2013 Sprint 09", "name": "2013 Sprint 09", "archived": true, "released": true, "releaseDate": "2013-05-06" } ], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2013-04-30T21:39:21.000+0000", "created": "2012-09-27T07:07:52.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "android", "assets", "core", "studio", "titanium" ], "versions": [], "issuelinks": [ { "id": "35265", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "111248", "key": "TIMOB-13075", "fields": { "summary": "Android:Module having images in assets folder installed in android application does not copy over assets during second build", "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": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-28T21:11: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": "12305", "name": "Core", "description": "Central component of the Platform (outside of Tooling, or platform specific implementation details)" } ], "description": "when any file is added to /platform/android/assets folder that file is not accessed by an SDK consumed by titanium module as it accesses file from the assets folder.\r\n\r\nAs analyzed any file which is present in /platform/android/assets folder is not copied by builder.py to /build/android/bin/assets folder. As a result this file is not picked by SDK consumed by titanium module.\r\n\r\nI tried modifying builder.py to fix the issue and it worked in all cases but not when /build/android/bin/assets is not created for the first time.\r\n\r\nI am attaching modified builder.py file for your reference and you can check the code added by searching comments having text \"Perminder\"\r\n\r\nI am using Titanium SDK 2.1.2GA\r\n\r\nPlease provide a quick resolution to this issue as this can halt a delivery. ", "attachment": [ { "id": "32226", "filename": "androidmodulestructure.png", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-02T21:09:12.000+0000", "size": 36499, "mimeType": "image/png" }, { "id": "32280", "filename": "AndroidSampleTC-130.zip", "author": { "name": "perminder.singh", "key": "perminder.singh", "displayName": "Perminder Singh Bhatia", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2012-10-04T07:40:08.000+0000", "size": 307336, "mimeType": "application/zip" }, { "id": "32099", "filename": "builder.py", "author": { "name": "perminder.singh", "key": "perminder.singh", "displayName": "Perminder Singh Bhatia", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2012-09-27T07:07:52.000+0000", "size": 84518, "mimeType": "text/x-python-script" } ], "flagged": false, "summary": "Titanium Studio does not copy contents of /platform/android/assets folder to /build/android/bin/assets folder", "creator": { "name": "perminder.singh", "key": "perminder.singh", "displayName": "Perminder Singh Bhatia", "active": true, "timeZone": "Asia/Kolkata" }, "subtasks": [], "reporter": { "name": "perminder.singh", "key": "perminder.singh", "displayName": "Perminder Singh Bhatia", "active": true, "timeZone": "Asia/Kolkata" }, "environment": "Android", "comment": { "comments": [ { "id": "221536", "author": { "name": "perminder.singh", "key": "perminder.singh", "displayName": "Perminder Singh Bhatia", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Please update", "updateAuthor": { "name": "perminder.singh", "key": "perminder.singh", "displayName": "Perminder Singh Bhatia", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2012-10-01T06:31:45.000+0000", "updated": "2012-10-01T06:31:45.000+0000" }, { "id": "221785", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Screenshot showing the correct folder structure.", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-02T21:09:12.000+0000", "updated": "2012-10-02T21:09:12.000+0000" }, { "id": "221790", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Perminder,\n\nIf you are making an android module, then I believe you are using the wrong folder structure. I have attached a screenshot showing the correct structure.\n\nThere's a wiki page here with more information: https://wiki.appcelerator.org/display/guides/Using+density-specific+resources+on+Android\n\nIf that still doesn't fix your issue, could you please provide some more information about what you are trying to achieve, and why you are doing it that way etc.\n\nIf it does, please let me know so that I can resolve the issue.\n\nThanks.", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-02T21:13:53.000+0000", "updated": "2012-10-02T21:13:53.000+0000" }, { "id": "221845", "author": { "name": "perminder.singh", "key": "perminder.singh", "displayName": "Perminder Singh Bhatia", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Hi Daniel,\nI am perfectly in sync with the link shared but i am not talking about images or resource files (res folder) and rather concerned about the configuration/non-resource files we bundle in an android project (assets folder). \n\nTo take a scenario, consider a normal Android project wherein we put a file named default.properties in Project/assets/properties folder which are then picked by the native code using this.getAssets().open(\"properties/default.properties\") but when i have to build such a scenario in Titanium App i have only choice of putting this file in Project/platform/android/assets/properties folder but this does not seems to work and this is for the reason which i described in the description section.\n\nNow, please help me in understand as if am i doing anything not supported by Titanium or doing in a wrong way.\n\nThanks.", "updateAuthor": { "name": "perminder.singh", "key": "perminder.singh", "displayName": "Perminder Singh Bhatia", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2012-10-03T07:00:30.000+0000", "updated": "2012-10-03T07:00:30.000+0000" }, { "id": "222045", "author": { "name": "perminder.singh", "key": "perminder.singh", "displayName": "Perminder Singh Bhatia", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Adding Sample Android Project explained in scenario as given in comment", "updateAuthor": { "name": "perminder.singh", "key": "perminder.singh", "displayName": "Perminder Singh Bhatia", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2012-10-04T07:40:08.000+0000", "updated": "2012-10-04T11:13:32.000+0000" }, { "id": "228109", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Perminder,\nSorry for the delay. So we tested this by creating a simple module project for Android, and inside exampleproxy.java we used this code inside the createView() method:\n{code}\ntry {\n Log.d(LCAT, \"Property from assets is.....\"+ this.getActivity().getAssets().open(\"properties/default.properties\"));\n InputStream stream = this.getActivity().getAssets().open(\"properties/default.properties\");\n \n Properties prop = new Properties();\n prop.load(stream);\n \n String propValue = prop.getProperty(\"prop.value1\");\n Toast.makeText(this.getActivity().getBaseContext(), propValue, Toast.LENGTH_LONG).show();\n} catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n}\n{code}\nWe then copied your properties file into assets folder.\nUnfortunately we could not reproduce the issue, the contents are copied as expected on 2.1.2 GA and 2.1.4 GA.", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-20T23:56:11.000+0000", "updated": "2012-11-20T23:56:11.000+0000" }, { "id": "229032", "author": { "name": "perminder.singh", "key": "perminder.singh", "displayName": "Perminder Singh Bhatia", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Daniel,\n\nUsing files in the assets folder in a Titanium Module Project will work, but if you want to use assets folder in a Titanium Application then it will not work.\n\nThe issue i want to report here is with respect to Titanium Application and not with Titanium Module. The problem i am facing is that if i want to give user an option to provide values in a properties file and add that properties file in assets folder under /platform/android/assets in a titanium application and want to read that properties file in my Titanium Module during runtime, then that is impossible as the file present under /platform/android/assets folder does not gets copied to /build/android/bin/assets folder. Since /build/android/bin/assets folder is created by builder.py script of Titanium SDK to create an Android project from Titanium Project to create an android application .apk file, this script does not happen to copy contents of /platform/android/assets folder to /build/android/bin/assets folder as a result final .apk file generated does not contain the .properties file and module is not able to access it.\n\nPlease re-open this issue as the problem is not understood properly.\n\nyou can ping me at permindersb on skype if you want more clarity.\n\nplease treat this issue dead critical now.", "updateAuthor": { "name": "perminder.singh", "key": "perminder.singh", "displayName": "Perminder Singh Bhatia", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2012-11-29T09:58:24.000+0000", "updated": "2012-11-29T09:58:24.000+0000" }, { "id": "244471", "author": { "name": "dstites", "key": "dstites", "displayName": "Daryl Stites", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Is there any update on if there is a workaround for this issue? I am encountering the same problem in 3.0.2 GA, with the Urban Airship module that references its configuration file in the (expected) /platform/android/assets instead of /platform/android/assets/Resources, which is the only folder I can get to copy during the build process.", "updateAuthor": { "name": "dstites", "key": "dstites", "displayName": "Daryl Stites", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-28T11:21:12.000+0000", "updated": "2013-03-28T11:21:12.000+0000" }, { "id": "249613", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Marking this bug as invalid.\r\n\r\nPlacing something inside /platform/android/assets folder should copy your files to /build/android/assets and NOT /build/android/bin/assets. I have verified that this works correctly in 3.1.0.GA.\r\n\r\nIf you would like to place something inside /build/android/bin/assets, you would need to place your files under /platform/android/bin/assets. I have verified that this works as well in 3.1.0.GA.\r\n", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-30T21:39:21.000+0000", "updated": "2013-04-30T21:39:21.000+0000" }, { "id": "249682", "author": { "name": "perminder.singh", "key": "perminder.singh", "displayName": "Perminder Singh Bhatia", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Allen,\r\n\r\nWhy is this invalid, rather it should be fixed for the current version and the justification for the same is that it was already proved to be a bug in previous versions whereas it is not occurring in current version. So, there is only one thing which could have happened to this bug is that it got fixed and no bug repairs itself whereas the people fixes them. ", "updateAuthor": { "name": "perminder.singh", "key": "perminder.singh", "displayName": "Perminder Singh Bhatia", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-05-01T05:54:00.000+0000", "updated": "2013-05-01T05:54:00.000+0000" }, { "id": "249730", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "As I mentioned in my comment above, the reported behavior specified in the bug is invalid. The /platform/android/assets should never copy to /build/android/bin/assets and that was never expected behavior. This is why the bug is invalid.", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-05-01T16:37:04.000+0000", "updated": "2013-05-01T16:37:04.000+0000" }, { "id": "416059", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-28T21:11:34.000+0000", "updated": "2017-03-28T21:11:34.000+0000" } ], "maxResults": 12, "total": 12, "startAt": 0 } } }