{ "id": "170505", "key": "TIMOB-25573", "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": "19988", "description": "", "name": "Release 7.0.1", "archived": false, "released": true, "releaseDate": "2017-12-21" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-12-08T18:31:56.000+0000", "created": "2017-11-30T11:55:34.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "cli", "ios", "merge-7.0.1", "sdk" ], "versions": [ { "id": "19906", "description": "", "name": "Release 6.3.0", "archived": false, "released": true, "releaseDate": "2017-11-01" } ], "issuelinks": [ { "id": "57696", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "173780", "key": "TIMOB-27166", "fields": { "summary": "CLI: re-enable removal of dead code on minification", "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" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "updated": "2019-06-19T12:54:43.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "Hi, I am having some issues with the compiler for iOS on Titanium 6.3.0 - when it compiles to the simulator it works fine but Device compiler breaks things.\r\n\r\nI have gotten the error down to standalone code on blank appcelerator classic app it build to ios device:\r\n\r\nAdd this code to the app.js and build\r\n{code:java}\r\nvar virtualScroller = {\r\n getView: function(i) {\r\n \r\n var web_view = Ti.UI.createWebView({\r\n \r\n }); \r\n \r\n web_view.addEventListener('click', function(){ \r\n \r\n });\r\n \r\n return web_view;\r\n },\r\n start: 1,\r\n infinite: false,\r\n itemCount: 12,\r\n };\r\n{code}\r\n\r\ncheck the build version of app_js\r\n\r\n{code:java}\r\nvar virtualScroller={getView:function(){var a=Ti.UI.createWebView({});return a.addEventListener('click',function(){}),a},start:1,infinite:!1,itemCount:12};\r\n{code}\r\n\r\nnotice that the ```return`` is before the eventlisteners and other values, this causes the code to return out and not function as it should", "attachment": [], "flagged": false, "summary": "CLI: iOS compiler breaks and compiles incorrectly when building to device - 6.3.0", "creator": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "iOS Devices\r\nTitanium SDK 6.3.0 (but also all other versions after install)\r\nMac OSX", "comment": { "comments": [ { "id": "431526", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "May be a duplicate of TIMOB-25328, although the return statement looks correctly. It adds the event-listener on return to save one line, but it still adds it.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-11-30T13:47:05.000+0000", "updated": "2017-11-30T13:47:05.000+0000" }, { "id": "431527", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "As a workaround, try to replace the file located i {{~/Library/Application Support/Titanium/mobilesdk/osx/6.3.0.GA/node_modules/node-titanium-sdk/lib/jsanalyze.js}} with [this file|https://raw.githubusercontent.com/feons/node-titanium-sdk/92a02476596bbda5257d624b1ea9a29b39a5174e/lib/jsanalyze.js].", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-11-30T13:49:14.000+0000", "updated": "2017-11-30T13:49:14.000+0000" }, { "id": "431528", "author": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "With the jsanalyze.js replace this is the compiled file\r\n\r\n{code:java}\r\nvar virtualScroller={getView:function(){var web_view=Ti.UI.createWebView({});return web_view.addEventListener('click',function(){}),web_view},start:1,infinite:!1,itemCount:12};\r\n{code}\r\n\r\nI apologize if I am wrong but I dont think this is valid code, but I might be wrong\r\n\r\n{code:java}\r\nreturn web_view.addEventListener('click',function(){}),web_view\r\n{code}\r\n\r\nThe new jsanalyze.js does seem to allow the code to work now but js miniy has now cause another issue with one of the modules, when I disable js minification all my code works fine...ill try to track it down", "updateAuthor": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-30T14:10:59.000+0000", "updated": "2017-11-30T14:51:23.000+0000" }, { "id": "431530", "author": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Here is what is happening now \r\n\r\nMy code:\r\n\r\n\r\n{code:java}\r\n// Set Args passed from other windows as args\r\nvar args = arguments[0] || {};\r\n\r\n// use args to set functions to run webViewClick and webViewScrollStart functions as passed from TextView\r\nargs.webViewClick = function(){webViewClick();};\r\nargs.webViewScrollStart = function(){webViewScrollStart();};\r\n\r\n//////////////////////////////////////////////////////////////////////////////////////////////////////\r\n// \t\t\t\t\tSTART IF - iPhone Remote Control Module and Functions\t\t\t\t\t\t\t//\r\n\r\n// START IF IOS ELSE ANDROID\r\nif (OS_IOS) {\r\n\t\r\n\t// require Control to get functions from IOS REMOTE\r\n\tvar Control = require('net.hoyohoyo.tiremotecontrol');\r\n\t\r\n\t// START Function - to setControlInfo with audioInfo\r\n\tfunction setControlInfo(currentChapter){\r\n\t\t\r\n\t\t// START - addEventListener to listen for events from Control - IOS Remote\r\n\t\tControl.addEventListener('remotecontrol', remoteControlFunctions);\r\n\r\n\t\t// set chapterName as bookDataArray[currentChapter].chapterName\r\n\t\tvar chapterName = getSetDatabaseData(\"getChapterName\",currentChapter);\r\n\t\tvar chapterNumber = getSetDatabaseData(\"getChapterNumber\",currentChapter);\r\n\r\n\t\tTi.API.info(chapterName + \" \" + chapterNumber);\r\n\t\t \r\n\t\t// setNowPlayingInfo\t\r\n\t\tControl.setNowPlayingInfo({\r\n\t\t\tartist: L(\"appName\"),\r\n\t\t\ttitle: chapterName + \" \" + chapterNumber,\r\n\t\t\talbumTitle: chapterName,\r\n\t\t\talbumArtworkLocal: true,\r\n\t\t\talbumArtwork: \"iTunesArtwork\",\r\n\t\t});\r\n\t\t\r\n\t\t// Log Now Playing info\r\n\t \tTi.API.info(\"Now Playing\" + L(\"appName\") + chapterName + \" \" + chapterNumber);\r\n\t\t\r\n\t};\r\n\t// END Function - to setControlInfo with audioInfo\r\n\t\r\n\t// START Function - remoteControlFunctions\r\n\tfunction remoteControlFunctions(e) {\r\n\t\t switch (e.subtype) {\r\n\t\t case Control.REMOTE_CONTROL_PLAY:\r\n\t\t \t\tTi.API.info('Remote control Play');\r\n\t\t \t\tTi.App.fireEvent(\"app:remoteAudioStartPause\");\r\n\t\t break;\r\n\t\t case Control.REMOTE_CONTROL_PAUSE:\r\n\t\t \t\tTi.API.info('Remote control Pause');\r\n\t\t \t\tTi.App.fireEvent(\"app:remoteAudioStartPause\");\r\n\t\t break;\r\n\t\t case Control.REMOTE_CONTROL_STOP:\r\n\t\t \t\tTi.API.info('Remote control Stop');\r\n\t\t break;\r\n\t\t case Control.REMOTE_CONTROL_PLAY_PAUSE:\r\n\t\t \t\tTi.API.info('Remote control Play/Pause');\r\n\t\t \t\tTi.App.fireEvent(\"app:remoteAudioStartPause\");\r\n\t\t break;\r\n\t\t case Control.REMOTE_CONTROL_PREV:\r\n\t\t \t\t\tTi.API.info('Remote control Prev');\r\n\t\t \t\t\t\r\n\t\t \t\t\t// run callback function goToPage\r\n\t\t \t\t\targs.goToPage({\r\n\t \t\tdirection: \"prev\",\r\n\t \t\t\tauto: \"auto\", \t\r\n\t \t\t}); \r\n\t \t\t \t\t\r\n\t\t break;\r\n\t\t case Control.REMOTE_CONTROL_NEXT:\r\n\t\t \t\tTi.API.info('Remote control Next');\r\n\t\t \t\t\r\n\t\t \t\t// run callback function goToPage\r\n\t\t \t\t\targs.goToPage({\r\n\t \t\tdirection: \"next\",\r\n\t \t\t\tauto: \"auto\", \t\r\n\t \t\t});\r\n\t \t\t\r\n\t\t break;\r\n\t\t }\r\n\t};\r\n\t// END Function - remoteControlFunctions\r\n\r\n};\r\n// END IF IOS ELSE ANDROID\r\n\r\n// \t\t\t\t\tSTART IF - iPhone Remote Control Module and Functions\t\t\t\t\t\t\t//\r\n//////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\r\n// START Function - webViewScrollerStart - to removeAudioView\r\nfunction webViewScrollStart(){\t\r\n\tTi.API.info(\"Scrolling Started\");\r\n\t\r\n\t// removeAudiView\r\n\tremoveAudioView();\r\n};\r\n// END Function - webViewScrollerStart - to removeAudioView\r\n\r\n// START Function - webViewClick - to addAudioView\r\nfunction webViewClick(){\r\n\tTi.API.info(\"WebviewClicked\");\r\n\t\r\n\t// addAudioView\r\n\taddAudioView();\r\n};\r\n// END Function - webViewClick - to addAudioView\r\n\r\n// START Function to - removeAudioView\r\nfunction removeAudioView(){\r\n\t\r\n\t// get Alloy Built In Animation\r\n\tvar animation = require('alloy/animation');\r\n\t// get audioVoew visibleValue\r\n\tvar audioViewVisible = $.audioView.visibleValue;\r\n\t\r\n\t// START IF - audioViewVisble true - hide $.audioView\r\n\tif (audioViewVisible){\t\r\n\t\tTi.API.info(\"Remove Audio View\");\r\n\t\t\r\n\t\t// use animation.fadeOut to hide view\r\n\t\tanimation.fadeOut($.audioView, 500);\r\n\t\t// set $.audioView.visibleValue as false\r\n\t\t$.audioView.visibleValue = false;\r\n\t\t\r\n\t};\r\n\t// END IF - audioViewVisble true - hide $.audioView\r\n\t\t\r\n};\r\n// END Function to - removeAudioView\r\n\r\n// START Function to - addAudioView\r\nfunction addAudioView(){\r\n\t\r\n\t// set audioView.visible as true\r\n\t$.audioView.visible = true;\r\n\t\r\n\t// get Alloy Built In Animation\r\n\tvar animation = require('alloy/animation');\r\n\t// get audioVoew visibleValue\r\n\tvar audioViewVisible = $.audioView.visibleValue;\r\n\t\r\n\t// START IF - audioViewVisible false\r\n\tif (audioViewVisible == false){\t\t\r\n\t\tTi.API.info(\"Add Audio View\");\r\n\t\t\r\n\t\t// use animation.fadeIn to show view\r\n\t\tanimation.fadeIn($.audioView, 500);\r\n\t\t\r\n\t\t// set $.audioView.visibleValue as true\r\n\t\t$.audioView.visibleValue = true;\r\n\t\t\r\n\t};\r\n\t// END IF - audioViewVisible false\t\r\n\t\r\n};\r\n// END Function to - addAudioView\r\n\r\n// set function to run when args.createAudioPlayer function is run from TextView\r\nargs.createAudioPlayer = function (createAudioPlayerData){\r\n\t\r\n\t// run createAudioPlayer\r\n\tcreateAudioPlayer(createAudioPlayerData);\r\n\t\r\n};\r\n\r\nvar audioPlayerFunctions = { removeAudioPlayer: function(){},\t\r\n};\r\n\r\n// START Function - to createAudioPlayer\r\nfunction createAudioPlayer(e){\r\n\t\r\n\t// Include the model in app/lib/\r\n\tvar audioPrepare = require('audioPrepare');\r\n\t\r\n\t// set autoPlay as e.autoPlay\r\n\tvar autoPlay = e.autoPlay;\r\n\t\r\n\t// START IF - check if has audioPlayer then remove before adding new\r\n\tif ($.audioPlayer.children[0]){\t\r\n\t\tTi.API.info(\"Remove old AudioPlayer\");\r\n\t\t\r\n\t\t// run hideAudioPlayer\r\n\t\thideAudioPlayer();\r\n\t};\r\n\t// END IF - check if has audioPlayer then remove before adding new\r\n\t\r\n\t// show audioView container\r\n \t$.audioView.bottom = 0;\r\n \t\r\n\t// set currentChapter as e.pageIndex\r\n\tvar currentChapter = e.pageIndex;\r\n\t\r\n\t// prepare audioPlayerView using audioPrepare model\r\n\tTi.API.info(\"creataAudioPlayer for Chapter:\" + currentChapter);\r\n\tvar audioPlayerData = {\r\n\t\tcreateClean:\"create\",\r\n\t\tcurrentChapter:currentChapter,\r\n\t\tautoPlay:autoPlay,\r\n\t\tgoToPage: function(goToPageData){\r\n\t\t\t// run callback function goToPage in TextView with data goToPageData from callback function in audiPrepare\r\n\t\t\targs.goToPage(goToPageData);\r\n\t\t},\r\n\t\taudioPlayerFunctions: audioPlayerFunctions,\t\r\n\t};\r\n\tvar audioPlayerView = audioPrepare(audioPlayerData);\r\n\t\r\n\t// add audioPlayerView to $.audioPlayer\r\n\t$.audioPlayer.add(audioPlayerView);\t\r\n\t\r\n\t// START IF - IOS - set Audio info in iOS Remote\r\n\tif (OS_IOS) {\r\n\t\tsetControlInfo(currentChapter);\r\n\t};\r\n\t// END IF - IOS - set Audio info in iOS Remote\r\n\t\r\n\t// fireEvent app.webViewClick to make sure audioView is shown\r\n\twebViewClick();\r\n\t\r\n};\r\n// END Function - to createAudioPlayer\r\n\r\n// set function to run when args.createAudioPlayer function is run from TextView\r\nargs.hideAudioPlayer = function (e){\r\n\t\r\n\t// run createAudioPlayer\r\n\thideAudioPlayer();\r\n\t\r\n};\r\n\r\n// START Function - to hideAudioPlayer\r\nfunction hideAudioPlayer(e){\r\n\r\n\t// START IF - check if has audioPlayer then remove\r\n\tif ($.audioPlayer.children[0]){\t\r\n\t\tTi.API.info(\"hideAudioPlayer: Remove old AudioPlayer\");\r\n\t\t\r\n\t\t// START IF - OS_IOS removeEventListener remotecontrol\r\n\t\tif(OS_IOS){\r\n\t\t\t\r\n\t\t\t// Remove Control EventListener\r\n\t\t\tControl.removeEventListener('remotecontrol', remoteControlFunctions);\r\n\t\t\t\r\n\t\t};\r\n\t\t// END IF - OS_IOS removeEventListener remotecontrol\r\n\r\n\t\t// FireEvent to Remove old App.eventListeners set in audioPrepare.js\r\n\t\taudioPlayerFunctions.removeAudioPlayer();\r\n\t\t\r\n\t\t// removeAllChildren from audioPlayer\t\t\r\n\t\t$.audioPlayer.removeAllChildren();\r\n\t\t// set audioPlayerView as null\r\n\t\taudioPlayerView = null;\t\t\r\n\t};\r\n\t// END IF - check if has audioPlayer then remove\r\n\t\r\n\t// Hide audioView container\r\n \t$.audioView.bottom = \"-60dp\";\r\n \t\r\n};\r\n// END Function - to hideAudioPlayer\r\n\r\n{code}\r\n\r\nnot minified result:\r\n\r\n\r\n{code:java}\r\nvar Alloy = require('/alloy'),\r\n Backbone = Alloy.Backbone,\r\n _ = Alloy._;\r\n\r\nfunction __processArg(obj, key) {\r\n var arg = null;\r\n if (obj) {\r\n arg = obj[key] || null;\r\n delete obj[key];\r\n }\r\n return arg;\r\n}\r\n\r\nfunction Controller() {\r\n\r\n require('/alloy/controllers/' + 'BaseController').apply(this, Array.prototype.slice.call(arguments));\r\n this.__controllerPath = 'audioPlayer';\r\n this.args = arguments[0] || {};\r\n\r\n if (arguments[0]) {\r\n var __parentSymbol = __processArg(arguments[0], '__parentSymbol');\r\n var $model = __processArg(arguments[0], '$model');\r\n var __itemTemplate = __processArg(arguments[0], '__itemTemplate');\r\n }\r\n var $ = this;\r\n var exports = {};\r\n var __defers = {};\r\n\r\n $.__views.audioView = Ti.UI.createView({ bottom: 0, left: 0, width: Ti.UI.FILL, height: \"60dp\", backgroundImage: \"/images/audio_back_trans.png\", backgroundRepeat: true, visibleValue: false, visible: false, id: \"audioView\" });\r\n $.__views.audioView && $.addTopLevelView($.__views.audioView);\r\n $.__views.audioPlayer = Ti.UI.createView({ id: \"audioPlayer\" });\r\n $.__views.audioView.add($.__views.audioPlayer);\r\n exports.destroy = function () {};\r\n\r\n _.extend($, $.__views);\r\n\r\n var args = arguments[0] || {};\r\n\r\n args.webViewClick = function () {\r\n webViewClick();\r\n };\r\n args.webViewScrollStart = function () {\r\n webViewScrollStart();\r\n };\r\n\r\n if (true) {\r\n var Control = require('net.hoyohoyo.tiremotecontrol');\r\n\r\n function setControlInfo(currentChapter) {\r\n Control.addEventListener('remotecontrol', remoteControlFunctions);\r\n\r\n var chapterName = getSetDatabaseData(\"getChapterName\", currentChapter);\r\n var chapterNumber = getSetDatabaseData(\"getChapterNumber\", currentChapter);\r\n\r\n Ti.API.info(chapterName + \" \" + chapterNumber);\r\n\r\n Control.setNowPlayingInfo({\r\n artist: L(\"appName\"),\r\n title: chapterName + \" \" + chapterNumber,\r\n albumTitle: chapterName,\r\n albumArtworkLocal: true,\r\n albumArtwork: \"iTunesArtwork\"\r\n });\r\n\r\n Ti.API.info(\"Now Playing\" + L(\"appName\") + chapterName + \" \" + chapterNumber);\r\n };\r\n\r\n function remoteControlFunctions(e) {\r\n switch (e.subtype) {\r\n case Control.REMOTE_CONTROL_PLAY:\r\n Ti.API.info('Remote control Play');\r\n Ti.App.fireEvent(\"app:remoteAudioStartPause\");\r\n break;\r\n case Control.REMOTE_CONTROL_PAUSE:\r\n Ti.API.info('Remote control Pause');\r\n Ti.App.fireEvent(\"app:remoteAudioStartPause\");\r\n break;\r\n case Control.REMOTE_CONTROL_STOP:\r\n Ti.API.info('Remote control Stop');\r\n break;\r\n case Control.REMOTE_CONTROL_PLAY_PAUSE:\r\n Ti.API.info('Remote control Play/Pause');\r\n Ti.App.fireEvent(\"app:remoteAudioStartPause\");\r\n break;\r\n case Control.REMOTE_CONTROL_PREV:\r\n Ti.API.info('Remote control Prev');\r\n\r\n args.goToPage({\r\n direction: \"prev\",\r\n auto: \"auto\"\r\n });\r\n\r\n break;\r\n case Control.REMOTE_CONTROL_NEXT:\r\n Ti.API.info('Remote control Next');\r\n\r\n args.goToPage({\r\n direction: \"next\",\r\n auto: \"auto\"\r\n });\r\n\r\n break;\r\n }\r\n };\r\n };\r\n\r\n function webViewScrollStart() {\r\n Ti.API.info(\"Scrolling Started\");\r\n\r\n removeAudioView();\r\n };\r\n\r\n function webViewClick() {\r\n Ti.API.info(\"WebviewClicked\");\r\n\r\n addAudioView();\r\n };\r\n\r\n function removeAudioView() {\r\n var animation = require('alloy/animation');\r\n\r\n var audioViewVisible = $.audioView.visibleValue;\r\n\r\n if (audioViewVisible) {\r\n Ti.API.info(\"Remove Audio View\");\r\n\r\n animation.fadeOut($.audioView, 500);\r\n\r\n $.audioView.visibleValue = false;\r\n };\r\n };\r\n\r\n function addAudioView() {\r\n $.audioView.visible = true;\r\n\r\n var animation = require('alloy/animation');\r\n\r\n var audioViewVisible = $.audioView.visibleValue;\r\n\r\n if (audioViewVisible == false) {\r\n Ti.API.info(\"Add Audio View\");\r\n\r\n animation.fadeIn($.audioView, 500);\r\n\r\n $.audioView.visibleValue = true;\r\n };\r\n };\r\n\r\n args.createAudioPlayer = function (createAudioPlayerData) {\r\n createAudioPlayer(createAudioPlayerData);\r\n };\r\n\r\n var audioPlayerFunctions = { removeAudioPlayer: function () {}\r\n };\r\n\r\n function createAudioPlayer(e) {\r\n var audioPrepare = require('audioPrepare');\r\n\r\n var autoPlay = e.autoPlay;\r\n\r\n if ($.audioPlayer.children[0]) {\r\n Ti.API.info(\"Remove old AudioPlayer\");\r\n\r\n hideAudioPlayer();\r\n };\r\n\r\n $.audioView.bottom = 0;\r\n\r\n var currentChapter = e.pageIndex;\r\n\r\n Ti.API.info(\"creataAudioPlayer for Chapter:\" + currentChapter);\r\n var audioPlayerData = {\r\n createClean: \"create\",\r\n currentChapter: currentChapter,\r\n autoPlay: autoPlay,\r\n goToPage: function (goToPageData) {\r\n args.goToPage(goToPageData);\r\n },\r\n audioPlayerFunctions: audioPlayerFunctions\r\n };\r\n var audioPlayerView = audioPrepare(audioPlayerData);\r\n\r\n $.audioPlayer.add(audioPlayerView);\r\n\r\n if (true) {\r\n setControlInfo(currentChapter);\r\n };\r\n\r\n webViewClick();\r\n };\r\n\r\n args.hideAudioPlayer = function (e) {\r\n hideAudioPlayer();\r\n };\r\n\r\n function hideAudioPlayer(e) {\r\n if ($.audioPlayer.children[0]) {\r\n Ti.API.info(\"hideAudioPlayer: Remove old AudioPlayer\");\r\n\r\n if (true) {\r\n Control.removeEventListener('remotecontrol', remoteControlFunctions);\r\n };\r\n\r\n audioPlayerFunctions.removeAudioPlayer();\r\n\r\n $.audioPlayer.removeAllChildren();\r\n\r\n audioPlayerView = null;\r\n };\r\n\r\n $.audioView.bottom = \"-60dp\";\r\n };\r\n\r\n _.extend($, exports);\r\n}\r\n\r\nmodule.exports = Controller;\r\n{code}\r\n\r\nminified result\r\n{code:java}\r\nvar Alloy=require('/alloy'),Backbone=Alloy.Backbone,_=Alloy._;function __processArg(obj,key){var arg=null;return obj&&(arg=obj[key]||null,delete obj[key]),arg}function Controller(){function webViewScrollStart(){Ti.API.info('Scrolling Started'),removeAudioView()}function webViewClick(){Ti.API.info('WebviewClicked'),addAudioView()}function removeAudioView(){var animation=require('alloy/animation'),audioViewVisible=$.audioView.visibleValue;audioViewVisible&&(Ti.API.info('Remove Audio View'),animation.fadeOut($.audioView,500),$.audioView.visibleValue=!1)}function addAudioView(){$.audioView.visible=!0;var animation=require('alloy/animation'),audioViewVisible=$.audioView.visibleValue;!1==audioViewVisible&&(Ti.API.info('Add Audio View'),animation.fadeIn($.audioView,500),$.audioView.visibleValue=!0)}function createAudioPlayer(e){var audioPrepare=require('audioPrepare'),autoPlay=e.autoPlay;$.audioPlayer.children[0]&&(Ti.API.info('Remove old AudioPlayer'),hideAudioPlayer()),$.audioView.bottom=0;var currentChapter=e.pageIndex;Ti.API.info('creataAudioPlayer for Chapter:'+currentChapter);var audioPlayerView=audioPrepare({createClean:'create',currentChapter:currentChapter,autoPlay:autoPlay,goToPage:function(goToPageData){args.goToPage(goToPageData)},audioPlayerFunctions:audioPlayerFunctions});$.audioPlayer.add(audioPlayerView),setControlInfo(currentChapter),webViewClick()}function hideAudioPlayer(){$.audioPlayer.children[0]&&(Ti.API.info('hideAudioPlayer: Remove old AudioPlayer'),Control.removeEventListener('remotecontrol',remoteControlFunctions),audioPlayerFunctions.removeAudioPlayer(),$.audioPlayer.removeAllChildren(),audioPlayerView=null),$.audioView.bottom='-60dp'}if(require('/alloy/controllers/BaseController').apply(this,Array.prototype.slice.call(arguments)),this.__controllerPath='audioPlayer',this.args=arguments[0]||{},arguments[0])var __parentSymbol=__processArg(arguments[0],'__parentSymbol'),$model=__processArg(arguments[0],'$model'),__itemTemplate=__processArg(arguments[0],'__itemTemplate');var $=this,exports={};$.__views.audioView=Ti.UI.createView({bottom:0,left:0,width:Ti.UI.FILL,height:'60dp',backgroundImage:'/images/audio_back_trans.png',backgroundRepeat:!0,visibleValue:!1,visible:!1,id:'audioView'}),$.__views.audioView&&$.addTopLevelView($.__views.audioView),$.__views.audioPlayer=Ti.UI.createView({id:'audioPlayer'}),$.__views.audioView.add($.__views.audioPlayer),exports.destroy=function(){},_.extend($,$.__views);var args=arguments[0]||{};args.webViewClick=function(){webViewClick()},args.webViewScrollStart=function(){webViewScrollStart()};{var Control=require('net.hoyohoyo.tiremotecontrol')}args.createAudioPlayer=function(createAudioPlayerData){createAudioPlayer(createAudioPlayerData)};var audioPlayerFunctions={removeAudioPlayer:function(){}};args.hideAudioPlayer=function(){hideAudioPlayer()},_.extend($,exports)}module.exports=Controller;\r\n{code}\r\n\r\nTons of missing code.....for example where is \r\n\r\n\r\n{code:java}\r\nfunction setControlInfo(currentChapter)\r\n{code}\r\n\r\n", "updateAuthor": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-30T14:58:59.000+0000", "updated": "2017-11-30T15:02:37.000+0000" }, { "id": "431585", "author": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I have found more instances where code gets stripped out even though it should not, it seems like its happening when the OS_IOS tag is used - this is really super frustrating as how are we supposed to be able to build and distribute apps if the cli is so bug ridden....I am not sure how I can be the only one finding these bugs, do most appcelerator users not actually have much code?\r\n\r\nThis code\r\n{code:java}\r\n if (bookID == 100){\r\n var convertedChapterName = L(\"booktitle\");\r\n }else{\r\n var convertedChapterName = L(\"booktitle2\"); \r\n } \r\n\r\n\r\n// START IF ANDROID > 4.0 ELSE\r\n var versionRequired = \"4.0\";\r\n if (OS_IOS || Ti.Platform.name == 'android' && versionCompare(Ti.Platform.version,versionRequired) == true) {\r\n \t var chapterNumberValue = chapterNumber;\r\n }else{\r\n \tvar chapterNumberValue = JSON.stringify(+chapterNumber).split(\"\").reverse().join(\"\");\r\n };\t\r\n // END IF ANDROID > 4.0 ELSE\r\n \r\n \t// set converted chapterName\r\n\t\t\t\t\t\tvar convertedBookName = Alloy.Globals.textConverter(bookName);\r\n\r\n// set message String and convert\r\n var message = convertedBookName + \" \\u200F\" + chapterNumberValue + convertedChapterName + \" \" + L(\"chapterDownloadComplete\");\r\n{code}\r\n\r\ngets minified:\r\n\r\n{code:java}\r\nvar chapterNumberValue,versionRequired=\"4.0\",convertedBookName=Alloy.Globals.textConverter(bookName),message=void 0+\" \\u200F\"+chapterNumber+void 0+\" \"+L(\"chapterDownloadComplete\");\r\n{code}\r\n\r\nnotice the void void\r\n\r\n", "updateAuthor": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-12-01T08:41:35.000+0000", "updated": "2017-12-01T08:53:17.000+0000" }, { "id": "431590", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "[~dieskim] As this occurs with all SDK versions since you upgraded could you try downgrading the appc cli using {{appc use 6.2.4}} and rebuilding to see if the issue still occurs?", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2017-12-01T10:33:10.000+0000", "updated": "2017-12-01T10:33:10.000+0000" }, { "id": "431593", "author": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "CLI ad 6.2.4:\r\n\r\n{code:java}\r\nvar chapterNumberValue,convertedBookName=Alloy.Globals.textConverter(bookName),message=void 0+\" \\u200F\"+chapterNumber+void 0+\" \"+L(\"chapterDownloadComplete\");\r\n{code}\r\n\r\nI also just did a search on all my build code for \"void\" tons and tons of them scattered throughout my codebase, will take many many hours to fix all of them with adding a log in front of each!", "updateAuthor": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-12-01T14:18:25.000+0000", "updated": "2017-12-01T15:19:21.000+0000" }, { "id": "431595", "author": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "so one way we have found to fix this is to actually just log out the var \r\n\r\nIn the example below adding `Ti.API.info(convertedBookName);` allows the value to not minify as \"void\" \r\n\r\n{code:java}\r\n\t// set converted chapterName\r\n\t\t\t\t\t\tvar convertedBookName = Alloy.Globals.textConverter(bookName); \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tTi.API.info(convertedBookName);\r\n\t\t\t\t\t\t\r\n // set message String and convert\r\n var message = convertedBookName + \" \\u200F\" + chapterNumber + convertedChapterName + \" \" + L(\"chapterDownloadComplete\");\r\n{code}\r\n\r\nthis compiles as \r\n\r\n\r\n{code:java}\r\nvar convertedBookName=Alloy.Globals.textConverter(bookName);Ti.API.info(convertedBookName);var message=convertedBookName+\" \\u200F\"+chapterNumber+convertedChapterName+\" \"+L(\"chapterDownloadComplete\");\r\n{code}\r\n", "updateAuthor": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-12-01T15:18:22.000+0000", "updated": "2017-12-01T15:18:22.000+0000" }, { "id": "431624", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "Looks like babel minify removes all {{function declarations}} in {{if statements}}. \r\nBut I'm not able to reproduce the {{void 0}} case yet.", "updateAuthor": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2017-12-01T22:57:12.000+0000", "updated": "2017-12-01T22:57:12.000+0000" }, { "id": "431626", "author": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Here is a complete test example to recreate the void 0 errors\r\n\r\nBuild the following in new blank alloy app - simply add this function only to the alloy.js - this code does seem to compile correctly on classic app. I believe its an issues with babel minify not understanding some alloy tags / code\r\n\r\n{code:java}\r\n// START FUNCTION - downloadChapter\r\nfunction downloadChapter(chapterID){\r\n \r\n // START - use checkDownloadURL and check for working URL \r\n checkDownloadURL.checkDownloadURL({\r\n method: 'GET',\r\n audioFileName: audioFileName,\r\n urlArrayString: urlArrayString,\r\n success: function (success) { // on Success\r\n Ti.API.info(\"Download Complete\");\r\n \r\n // set convertedChapterName\r\n //var convertedChapterName; \r\n if (bookID == 100){\r\n var convertedChapterName = L(\"book1\");\r\n }else{\r\n var convertedChapterName = L(\"book2\"); \r\n }; \r\n //Ti.API.info(convertedChapterName); \r\n \r\n \t// set converted chapterName\r\n\t\t\t\t\t\tvar convertedBookName = Alloy.Globals.textConverter(bookName); \t\t\t\t\t\r\n\t\t\t\t\t\t//Ti.API.info(convertedBookName);\r\n\t\t\t\t\t\t\r\n // set message String and convert\r\n var message = convertedBookName + chapterNumber + convertedChapterName + \" \" + L(\"chapterDownloadComplete\");\r\n \r\n // fire app:showAlertMessage with message\r\n Ti.App.fireEvent(\"app:showAlertMessage\",{\r\n message: message, \r\n }); \r\n \r\n if (OS_ANDROID){\r\n \r\n // set converted bookName\r\n var convertedBookName = Alloy.Globals.textConverter(bookName); \r\n \r\n // START IF - Add Catagory\r\n if (bookID == 100){ \r\n var convertedChapterName = L(\"book2\"); \r\n }else{ \r\n var convertedChapterName = L(\"book4\"); \r\n };\r\n // END IF - Add Catagory\r\n \r\n };\r\n \r\n },\r\n datastream: function(datastream) { // on Datastream\r\n Ti.API.info('Download - Progress: ' + datastream.progress); \r\n }, \r\n error: function (error) { // on Error\r\n Ti.API.info('Download Error' + error);\r\n },\r\n });\r\n // END - use checkDownloadURL and check for working URL\r\n \r\n};\r\n// END FUNCTION - downloadChapter\r\n{code}\r\n \r\nBuilds as:\r\n\r\n\r\n{code:java}\r\nvar Alloy=require('/alloy'),_=Alloy._,Backbone=Alloy.Backbone;function downloadChapter(){checkDownloadURL.checkDownloadURL({method:'GET',audioFileName:audioFileName,urlArrayString:urlArrayString,success:function(){if(Ti.API.info('Download Complete'),100==bookID)var convertedChapterName=L('book1');else var convertedChapterName=L('book2');var convertedBookName=Alloy.Globals.textConverter(bookName),message=void 0+chapterNumber+void 0+' '+L('chapterDownloadComplete');Ti.App.fireEvent('app:showAlertMessage',{message:message});var convertedChapterName},datastream:function(datastream){Ti.API.info('Download - Progress: '+datastream.progress)},error:function(error){Ti.API.info('Download Error'+error)}})}Alloy.createController('index');\r\n{code}\r\n\r\nremoving the OS_ANDROID part \r\n\r\n{code:java}\r\nif (OS_ANDROID){\r\n \r\n // set converted bookName\r\n var convertedBookName = Alloy.Globals.textConverter(bookName); \r\n \r\n // START IF - Add Catagory\r\n if (bookID == 100){ \r\n var convertedChapterName = L(\"book2\"); \r\n }else{ \r\n var convertedChapterName = L(\"book4\"); \r\n };\r\n // END IF - Add Catagory\r\n \r\n };\r\n{code}\r\n\r\nallows the void 0 mistakes to disappear, but thats not really a solution - just shows the cause of the problem is related to OS_ANDROID and OS_IOS\r\n\r\nSimply adding logs \r\n\r\n{code:java}\r\nTi.API.info(convertedChapterName);\r\n{code}\r\n\r\nand \r\n\r\n{code:java}\r\nTi.API.info(convertedBookName);\r\n{code}\r\n\r\nfixes the with both void 0 errors\r\n", "updateAuthor": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-12-02T02:53:48.000+0000", "updated": "2017-12-02T03:02:21.000+0000" }, { "id": "431649", "author": { "name": "joachim.haglund", "key": "joachim.haglund", "displayName": "joachim.haglund", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I also had alot of issues with minification removing function declarations in if statements, along with other wierd bugs due to minification. I found that assigning the function declaration to a var would solve issues with functions being removed. Additionally variables randomly become null or wierd values, logging them just before using htem worked.\r\n\r\nSometimes functions declared normally, outisde if statements, also bugged in diffrent ways. When this happend i found that declaring a new function as an identical copy with a new name, just below the bugged function, solved the problem.\r\n\r\nThe code becomes very ugly when making these workarounds, so i really hope this is fixed soon.", "updateAuthor": { "name": "joachim.haglund", "key": "joachim.haglund", "displayName": "joachim.haglund", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-12-04T08:32:56.000+0000", "updated": "2017-12-04T08:32:56.000+0000" }, { "id": "431684", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "PR: https://github.com/appcelerator/node-titanium-sdk/pull/19", "updateAuthor": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2017-12-04T17:59:34.000+0000", "updated": "2017-12-04T17:59:34.000+0000" }, { "id": "431713", "author": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thanks for the PR! So basically just turn off more and more minification? Did you guys recently switch to a different minification tool or why are things breaking now?", "updateAuthor": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-12-05T06:00:45.000+0000", "updated": "2017-12-05T06:00:45.000+0000" }, { "id": "431714", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "[~dieskim], Yes, we replaced UglifyJS with Babili so that we can support ES2015 and newer in the tooling. It's minification and dead code removal seems pretty aggressive, there are also some known issues (i.e https://github.com/babel/minify/issues/404). \r\n", "updateAuthor": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2017-12-05T06:14:15.000+0000", "updated": "2017-12-05T06:14:15.000+0000" }, { "id": "431715", "author": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Yes I did notice those issues on the repo, does not seem like they are being handled... turning off minification functions is not ideal as it almost defies the whole point, but I guess at this stage its the best we can do?", "updateAuthor": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-12-05T06:22:38.000+0000", "updated": "2017-12-05T06:22:38.000+0000" }, { "id": "431717", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "For best practice, use function expressions for conditional creation instead.", "updateAuthor": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2017-12-05T06:46:39.000+0000", "updated": "2017-12-05T06:46:39.000+0000" }, { "id": "432460", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified Fix in SDK version {{7.0.1.v20171218104141}} and {{7.1.0.v20171220095337}} with test case mentioned in the description; device compiler no longer broke.\r\n\r\n*Test Environment*\r\nAppcelerator Command-Line Interface, version 7.0.0\r\niphone 5s (11.0.3)\r\nOperating System Name: Mac OS High Sierra \r\nOperating System Version: 10.13\r\nNode.js Version: 8.9.1\r\nXcode: 9.0.1\r\nAppcelerator Studio: 5.0.0.201711280737", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-12-20T21:42:17.000+0000", "updated": "2017-12-20T21:42:17.000+0000" } ], "maxResults": 18, "total": 18, "startAt": 0 } } }