{ "id": "106167", "key": "TIMOB-11995", "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": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2017-07-19T17:45:23.000+0000", "created": "2012-12-07T19:37:02.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [], "versions": [ { "id": "14137", "description": "Release 2.1.3", "name": "Release 2.1.3", "archived": true, "released": true, "releaseDate": "2012-10-03" } ], "issuelinks": [], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-07-19T17:45:23.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": "If a proxy object defines a property using {{propertyAccessors}} and also defines a custom setter for the property, build fails with the following cryptic (and completely misleading) message:\r\n\r\n{code}\r\nExecuting build.xml...\r\n/Library/Application Support/Titanium/mobilesdk/osx/2.1.4.GA/module/android/build.xml:191: The following error occurred while executing this line:\r\n/Library/Application Support/Titanium/mobilesdk/osx/2.1.4.GA/module/android/build.xml:236: The following error occurred while executing this line:\r\n/Library/Application Support/Titanium/mobilesdk/osx/2.1.4.GA/module/android/build.xml:240: The following error occurred while executing this line:\r\n/Library/Application Support/Titanium/mobilesdk/osx/2.1.4.GA/module/android/build.xml:221: Java returned: -1You may need to install the Command Line Tools package through XCode, in case you haven't done so yet.\r\n{code}\r\n\r\nSample code follows:\r\n{code}\r\n/**\r\n * This file was auto-generated by the Titanium Module SDK helper for Android\r\n * Appcelerator Titanium Mobile\r\n * Copyright (c) 2009-2010 by Appcelerator, Inc. All Rights Reserved.\r\n * Licensed under the terms of the Apache Public License\r\n * Please see the LICENSE included with this distribution for details.\r\n *\r\n */\r\npackage com.evarino.actionbarsearch;\r\n\r\nimport java.util.HashMap;\r\n\r\nimport org.appcelerator.kroll.KrollDict;\r\nimport org.appcelerator.kroll.KrollProxy;\r\nimport org.appcelerator.kroll.annotations.Kroll;\r\nimport org.appcelerator.titanium.TiC;\r\nimport org.appcelerator.titanium.util.Log;\r\nimport org.appcelerator.titanium.util.TiConfig;\r\nimport org.appcelerator.titanium.util.TiConvert;\r\nimport org.appcelerator.titanium.proxy.TiViewProxy;\r\nimport org.appcelerator.titanium.view.TiCompositeLayout;\r\nimport org.appcelerator.titanium.view.TiCompositeLayout.LayoutArrangement;\r\nimport org.appcelerator.titanium.view.TiUIView;\r\nimport android.app.Activity;\r\nimport android.os.Build;\r\nimport android.widget.SearchView;\r\n\r\n\r\n// This proxy can be created by calling Actionbarsearch.createExample({message: \"hello world\"})\r\n@Kroll.proxy(creatableInModule = ActionbarsearchModule.class, propertyAccessors = {\r\n\t\t\"prompt\", \"hintText\", \"showCancel\", \"value\" })\r\npublic class ABSearchViewProxy extends TiViewProxy {\r\n\t// Standard Debugging variables\r\n\tprivate static final String LCAT = \"SearchProxy\";\r\n\tprivate static final boolean DBG = TiConfig.LOGD;\r\n\t\r\n\t// property names\r\n\tprivate static final String HINT_TEXT = \"hintText\";\r\n\tprivate static final String VALUE = \"value\";\r\n\tprivate static final String ICONIFIED = \"iconified\";\r\n\tprivate static final String ICONIFIED_BY_DEFAULT = \"iconifiedByDefault\";\r\n\r\n\r\n\t// Event names -- matched to SearchBar for consistency -- except \"submit\", which is android-specific.\r\n\tprivate static final String TEXT_CHANGE_EVENT = \"change\";\r\n\tprivate static final String TEXT_SUBMIT_EVENT = \"submit\";\r\n\tprivate static final String CLOSE_EVENT = \"cancel\";\r\n\r\n\r\n\tprivate class ABSearchView extends TiUIView implements SearchView.OnQueryTextListener, SearchView.OnCloseListener {\r\n\t\tprivate SearchView searchView;\r\n\t\t\r\n\t\tpublic ABSearchView(TiViewProxy proxy) {\r\n\t\t\tsuper(proxy);\r\n\t\t\tif (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {\r\n\t\t\t\tsearchView = new SearchView(proxy.getActivity());\r\n\t\t\t\tsearchView.setOnQueryTextListener(this);\r\n\t\t\t\tsearchView.setOnCloseListener(this);\r\n\t\t\t\tsetNativeView(searchView);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t@Override\r\n\t\tpublic void processProperties(KrollDict props) {\r\n\t\t\tsuper.processProperties(props);\r\n\t\t\t\r\n\t\t\tLog.d(LCAT,\"[VIEW LIFECYCLE EVENT] processProperties \" + props);\r\n\r\n\t\t\t// Check if the hint text is specified when the view is created.\r\n\t\t\tif (props.containsKey(HINT_TEXT)) {\r\n\t\t\t\tsearchView.setQueryHint(props.getString(HINT_TEXT));\t\t\t\r\n\t\t\t} \r\n\t\t\tif (props.containsKey(VALUE)) {\r\n\t\t\t\tsearchView.setQuery(props.getString(VALUE), false);\t\t\t\r\n\t\t\t} \r\n\t\t\tif (props.containsKey(ICONIFIED)) {\r\n\t\t\t\tsearchView.setIconified(props.getBoolean(ICONIFIED));\r\n\t\t\t} \r\n\t\t\tif (props.containsKey(ICONIFIED_BY_DEFAULT)) {\r\n\t\t\t\tsearchView.setIconified(props.getBoolean(ICONIFIED_BY_DEFAULT));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t@Override\r\n\t\tpublic void propertyChanged(String key, Object oldValue, Object newValue, KrollProxy proxy) {\r\n\t\t\tLog.d(LCAT, \"Got change event for: \" + key);\r\n\t\t\tif (key.equals(HINT_TEXT)) {\r\n\t\t\t\tsearchView.setQueryHint((String) newValue);\r\n\t\t\t} else if (key.equals(VALUE)) {\r\n\t\t\t\tsearchView.setQuery((String) newValue, false);\t\t\t\r\n\t\t\t}\r\n\t\t\telse if (key.equals(ICONIFIED)) {\r\n\t\t\t\tsearchView.setIconified(TiConvert.toBoolean(newValue));\r\n\t\t\t} else if (key.equals(ICONIFIED_BY_DEFAULT)) {\r\n\t\t\t\tsearchView.setIconified(TiConvert.toBoolean(newValue));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t@Override\r\n\t\tpublic boolean onClose() {\r\n\t\t\tif (proxy.hasListeners(CLOSE_EVENT)) {\r\n\t\t\t\tproxy.fireEvent(CLOSE_EVENT, null);\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\t\t}\r\n\r\n\t\t@Override\r\n\t\tpublic boolean onQueryTextChange(String query) {\r\n\t\t\t\t// It is a good idea to check if there are listeners for the event that\r\n\t\t\t\t// is about to be fired. There could be zero or multiple listeners for the\r\n\t\t\t\t// specified event.\r\n\t\t\t\t\r\n\t\t\t\tproxy.setProperty(VALUE, query);\r\n\t\t\t\t\r\n\t\t\t\tif (proxy.hasListeners(TEXT_CHANGE_EVENT)) {\r\n\t\t\t\t\tproxy.fireEvent(TEXT_CHANGE_EVENT, null);\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t@Override\r\n\t\tpublic boolean onQueryTextSubmit(String query) {\r\n\t\t\t\r\n\t\t\tif (proxy.hasListeners(TEXT_SUBMIT_EVENT)) {\r\n\t\t\t\tproxy.fireEvent(TEXT_SUBMIT_EVENT, null);\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}\r\n\r\n\t// Constructor\r\n\tpublic ABSearchViewProxy() {\r\n\t\tsuper();\r\n\t}\r\n\r\n\t@Override\r\n\tpublic TiUIView createView(Activity activity) {\r\n\t\tTiUIView view = new ABSearchView(this);\r\n\t\tview.getLayoutParams().autoFillsHeight = true;\r\n\t\tview.getLayoutParams().autoFillsWidth = true;\r\n\t\treturn view;\r\n\t}\r\n\r\n\t// Handle creation options\r\n\t@Override\r\n\tpublic void handleCreationDict(KrollDict options) {\r\n\t\tsuper.handleCreationDict(options);\r\n\r\n\t\tif (options.containsKey(\"message\")) {\r\n\t\t\tLog.d(LCAT,\r\n\t\t\t\t\t\"example created with message: \" + options.get(\"message\"));\r\n\t\t}\r\n\t}\r\n\r\n\t// Methods\r\n\t@Kroll.method\r\n\tpublic void printMessage(String message) {\r\n\t\tLog.d(LCAT, \"printing message: \" + message);\r\n\t}\r\n\r\n\t@Kroll.getProperty\r\n\t@Kroll.method\r\n\tpublic String getMessage() {\r\n\t\treturn (String) getProperty(\"message\");\r\n\t}\r\n\r\n\t@Kroll.setProperty(retain=true)\r\n\t@Kroll.method\r\n\tpublic void setMessage(String message) {\r\n\t\tLog.d(LCAT, \"Tried setting module message to: \" + message);\r\n\t\t//setPropertyAndFire(\"message\", message);\r\n\t}\r\n\t\r\n\t@Kroll.setProperty\r\n\t@Kroll.method\r\n\tpublic void setHintText(String text) {\r\n\t\tLog.d(LCAT, \"Tried setting module message to: \" + text);\r\n\t\t//setProperty(\"hintText\", text);\r\n\t}\r\n}\r\n{code}\r\n\r\nAfter commenting out the {{setHintText}} method and removing the build directory, the module builds fine.\r\n\r\nSince a similar pattern works on iOS, people are likely to expect it will work on Android. \r\n\r\nI will document it, but it would be good if we could provide a better error message, as well. ", "attachment": [], "flagged": false, "summary": "Android: Duplicate setter in module causes cryptic packaging failure ", "creator": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "230428", "author": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "body": "It appears that the failure is in the rhino.idswitch code, which isn't ours. Perhaps we can just fix the Ant buildfile to give a better message when this script fails, indicating that it could be because of a duplicate identifier OR missing Xcode tools.", "updateAuthor": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-12-07T19:45:03.000+0000", "updated": "2012-12-07T19:45:03.000+0000" }, { "id": "424378", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket due to time passed and lack of progress for a number of years. Please open a new ticket if there are any problems.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-07-19T17:45:23.000+0000", "updated": "2017-07-19T17:45:23.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }