{ "id": "170178", "key": "TIMOB-25456", "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": "17609", "description": "", "name": "Release 7.0.0", "archived": false, "released": true, "releaseDate": "2017-12-07" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-11-13T22:45:28.000+0000", "created": "2017-10-30T11:49:45.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "android" ], "versions": [ { "id": "18414", "description": "", "name": "Release 6.2.0", "archived": false, "released": true, "releaseDate": "2017-09-13" } ], "issuelinks": [ { "id": "56109", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "170177", "key": "TIMOB-25458", "fields": { "summary": "Android ActionBar causes App Crash - Titanium sdk 6.2.2", "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": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "updated": "2017-11-23T17:26:46.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": "Calling `Stringify` on a Window instance before it has been opened crashes the application.\r\n\r\n*Test case:*\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow();\r\nTi.API.error(JSON.stringify(win));\r\nwin.open();\r\n{code}\r\n\r\n_Result_: Application crashes.\r\n_Expected behavior_: Application should not crash.\r\n\r\n*Console log:*\r\n\r\n{code:console}\r\n[WARN] : W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method ‘void android.support.v7.app.ActionBar.setDisplayOptions(int)’ on a null object reference\r\n[WARN] : W/System.err: at org.appcelerator.titanium.proxy.ActionBarProxy.(ActionBarProxy.java:58)\r\n[WARN] : W/System.err: at org.appcelerator.titanium.proxy.ActivityProxy.getActionBar(ActivityProxy.java:258)\r\n[WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method)\r\n[WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:196)\r\n[WARN] : W/System.err: at org.appcelerator.kroll.KrollRuntime.runModule(KrollRuntime.java:243)\r\n[WARN] : W/System.err: at org.appcelerator.titanium.TiLaunchActivity.loadActivityScript(TiLaunchActivity.java:128)\r\n[WARN] : W/System.err: at org.appcelerator.titanium.TiLaunchActivity.windowCreated(TiLaunchActivity.java:183)\r\n[WARN] : W/System.err: at org.appcelerator.titanium.TiRootActivity.windowCreated(TiRootActivity.java:172)\r\n[WARN] : W/System.err: at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:684)\r\n[WARN] : W/System.err: at org.appcelerator.titanium.TiLaunchActivity.onCreate(TiLaunchActivity.java:169)\r\n[WARN] : W/System.err: at org.appcelerator.titanium.TiRootActivity.onCreate(TiRootActivity.java:161)\r\n[WARN] : W/System.err: at android.app.Activity.performCreate(Activity.java:6679)\r\n[WARN] : W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)\r\n[WARN] : W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)\r\n[WARN] : W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)\r\n[WARN] : W/System.err: at android.app.ActivityThread.-wrap12(ActivityThread.java)\r\n[WARN] : W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)\r\n[WARN] : W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)\r\n[WARN] : W/System.err: at android.os.Looper.loop(Looper.java:154)\r\n[WARN] : W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6119)\r\n[WARN] : W/System.err: at java.lang.reflect.Method.invoke(Native Method)\r\n[WARN] : W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)\r\n[WARN] : W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android: Crash after calling Stringify on Ti.UI.Window", "creator": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "subtasks": [], "reporter": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "environment": null, "comment": { "comments": [ { "id": "430241", "author": { "name": "perdona", "key": "perdona", "displayName": "Caio Perdona", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Getting the same error here, with SDK 6.3.0.GA.\r\nIs there any workaround for this?\r\nMy log is below:\r\n\r\n{noformat}\r\n[ERROR] TiExceptionHandler: (main) [0,333] - Message: Uncaught Attempt to invoke virtual method ‘void android.support.v7.app.ActionBar.setDisplayOptions(int)’ on a null object reference\r\n{noformat}", "updateAuthor": { "name": "perdona", "key": "perdona", "displayName": "Caio Perdona", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-07T20:42:19.000+0000", "updated": "2017-11-07T20:42:19.000+0000" }, { "id": "430286", "author": { "name": "perdona", "key": "perdona", "displayName": "Caio Perdona", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I have a constructor for my windows, so that I can customize programmatically some window properties.\r\nBelow is the code I'm using, it may help you identify the bug...\r\nPS: I tried to play with some timeouts (because Ti seems to lose reference of activity/actionBar) but did not have any luck. \r\n\r\n\r\n{code:javascript}\r\nexports.window = function(args) {\r\n\r\n args[\"backgroundColor\"] = args[\"backgroundColor\"] || \"#fff\";\r\n args[\"orientationModes\"] = args[\"orientationModes\"] || [Ti.UI.LANDSCAPE_LEFT, Ti.UI.LANDSCAPE_RIGHT, Ti.UI.PORTRAIT];\r\n\r\n var logo = ui.image({\r\n image: \"/img/general/logo-pinion.png\",\r\n width: 100,\r\n height: 24\r\n });\r\n\r\n if (osname == \"iphone\") {\r\n args[\"titleAttributes\"] = {color: \"#fff\"};\r\n args[\"titleControl\"] = (args[\"title\"]) ? null : logo;\r\n args[\"navTintColor\"] = \"#fff\";\r\n args[\"tintColor\"] = args[\"tintColor\"] || \"#328cff\";\r\n args[\"barColor\"] = args[\"barColor\"] || \"#025ed1\";\r\n args[\"backButtonTitle\"] = args[\"backButtonTitle\"] || L(\"navBackBt\");\r\n args[\"statusBarStyle\"] = Ti.UI.iOS.StatusBar.LIGHT_CONTENT;\r\n } else {\r\n args[\"windowSoftInputMode\"] = Ti.UI.Android.SOFT_INPUT_STATE_HIDDEN | Ti.UI.Android.SOFT_INPUT_ADJUST_PAN;\r\n args[\"theme\"] = args[\"theme\"] || \"Theme.AppCompat.Light.DarkActionBar\";\r\n }\r\n\r\n var w = Ti.UI.createWindow(args);\r\n\r\n if (args[\"hasLoading\"]) {\r\n ui.loading(w, args[\"slay\"] || false);\r\n }\r\n\r\n if (osname == \"android\" && !args[\"tabgroupWin\"]) {\r\n\r\n w.addEventListener(\"open\", function(e) {\r\n w.addEventListener(\"open\", function(e) {\r\n // CHANGE ACTIONBAR COLOR\r\n abx.window = w;\r\n abx.setBackgroundColor(\"#025ed1\");\r\n\r\n var activity = w.getActivity();\r\n var actionBar = activity.getActionBar();\r\n\r\n if (actionBar) {\r\n if (args[\"canGoBack\"]) {\r\n actionBar.setDisplayHomeAsUp(true);\r\n actionBar.onHomeIconItemSelected = function() {\r\n w.close();\r\n };\r\n }\r\n }\r\n\r\n if (args[\"report\"] || args[\"settings\"]) {\r\n\r\n activity.onCreateOptionsMenu = function(e) {\r\n\r\n var menu = e.menu;\r\n menu.clear();\r\n\r\n if (args[\"report\"]) {\r\n ui.createNavIcon(\"report\", args[\"report\"], \"android\", menu);\r\n }\r\n\r\n if (args[\"settings\"]) {\r\n ui.createNavIcon(\"settings\", null, \"android\", menu);\r\n }\r\n\r\n };\r\n\r\n }\r\n\r\n });\r\n\r\n w.fbProxy = fb.createActivityWorker({lifecycleContainer: w});\r\n\r\n } else if (osname == \"iphone\") {\r\n\r\n if (args[\"settings\"]) {\r\n w.setLeftNavButton(ui.createNavIcon(\"settings\"));\r\n }\r\n\r\n if (args[\"report\"]) {\r\n w.setRightNavButton(ui.createNavIcon(\"report\", args[\"report\"]));\r\n }\r\n\r\n if (args[\"mapview\"]) {\r\n w.setRightNavButton(ui.createNavIcon(\"mapview\"));\r\n }\r\n\r\n if (args[\"redeem\"]) {\r\n w.setLeftNavButton(ui.createNavIcon(\"redeem\"));\r\n }\r\n\r\n }\r\n\r\n return w;\r\n};\r\n{code}", "updateAuthor": { "name": "perdona", "key": "perdona", "displayName": "Caio Perdona", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-08T14:17:23.000+0000", "updated": "2017-11-08T14:17:23.000+0000" }, { "id": "430551", "author": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR passed; PR merged.", "updateAuthor": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-13T22:45:28.000+0000", "updated": "2017-11-13T22:45:28.000+0000" }, { "id": "430576", "author": { "name": "perdona", "key": "perdona", "displayName": "Caio Perdona", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thats great news! =]\r\nCan you provide us more information to workaround in current SDK version?\r\nThanks!", "updateAuthor": { "name": "perdona", "key": "perdona", "displayName": "Caio Perdona", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-14T04:22:21.000+0000", "updated": "2017-11-14T04:22:21.000+0000" }, { "id": "430666", "author": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Changes are seen in SDK 7.0.0.v20171114202841.", "updateAuthor": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-15T06:04:03.000+0000", "updated": "2017-11-15T06:04:03.000+0000" }, { "id": "431128", "author": { "name": "perdona", "key": "perdona", "displayName": "Caio Perdona", "active": true, "timeZone": "America/Los_Angeles" }, "body": "What about current projects that need to be released on CURRENT 6.3.0.GA SDK?", "updateAuthor": { "name": "perdona", "key": "perdona", "displayName": "Caio Perdona", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-21T20:41:14.000+0000", "updated": "2017-11-21T20:41:14.000+0000" }, { "id": "431131", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~perdona] Please feel free to patch the following [5 lines|https://github.com/appcelerator/titanium_mobile/pull/9570/files#diff-795f7c4f31e823f6efcb79974c240224R58-R63] using the linked change. You just check-out the 6_3_X branch, which is the stable GA, apply the patch, compile it in build/ by using {{node scons.js cleanbuild}} and use the resulting SDK (will be 6.3.1). Hope that helps! Otherwise we'll grab a build for you ;-).", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-11-21T20:48:24.000+0000", "updated": "2017-11-21T20:48:24.000+0000" }, { "id": "431180", "author": { "name": "perdona", "key": "perdona", "displayName": "Caio Perdona", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hans, thanks for the feedback.\r\nI'm trying to build the module here, but I'm getting the following\r\n\r\n{noformat}\r\nBUILD SUCCESSFUL\r\nTotal time: 3 seconds\r\npath.js:7\r\n throw new TypeError('Path must be a string. Received ' + inspect(path));\r\n ^\r\n\r\nTypeError: Path must be a string. Received null\r\n at assertPath (path.js:7:11)\r\n at Object.join (path.js:1213:7)\r\n at AndroidSDK.getPlatformDir (/Users/perdona/Dev/lab/TI/titanium_mobile/build/androidsdk.js:64:24)\r\n at Android.build (/Users/perdona/Dev/lab/TI/titanium_mobile/build/android.js:52:28)\r\n at /Users/perdona/Dev/lab/TI/titanium_mobile/build/scons-cleanbuild.js:95:26\r\n at /Users/perdona/Dev/lab/TI/titanium_mobile/node_modules/async/dist/async.js:3047:16\r\n at replenish (/Users/perdona/Dev/lab/TI/titanium_mobile/node_modules/async/dist/async.js:982:17)\r\n at /Users/perdona/Dev/lab/TI/titanium_mobile/node_modules/async/dist/async.js:986:9\r\n at eachLimit$1 (/Users/perdona/Dev/lab/TI/titanium_mobile/node_modules/async/dist/async.js:3133:22)\r\n at Object. (/Users/perdona/Dev/lab/TI/titanium_mobile/node_modules/async/dist/async.js:1016:16)\r\n{noformat}\r\n\r\n(Maybe my node environment is broken?)\r\nCan you provide or a workaround for this error in my build?", "updateAuthor": { "name": "perdona", "key": "perdona", "displayName": "Caio Perdona", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-22T18:48:08.000+0000", "updated": "2017-11-22T18:48:08.000+0000" }, { "id": "431220", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Looks like your Android SDK / NDK path is not set correctly. Change with {{appc ti setup android}}. For example, my android-sdk is in {{/opt/android-sdk}} and the android-ndk in {{/opt/android-ndk}}.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-11-23T15:32:40.000+0000", "updated": "2017-11-23T15:32:40.000+0000" }, { "id": "431222", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "I generated a custom 6_3_X SDK (6.3.1) with this ticket being added, feel free to test it [~perdona]! Please note that we cannot do that all the time, so try to fix the build-setup as well to be more flexible for the future :-)\r\n\r\nDownload: https://www.dropbox.com/s/zelfowjcypj4a1h/mobilesdk-6.3.1-perdona.zip?dl=1", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-11-23T16:07:35.000+0000", "updated": "2017-11-23T16:07:35.000+0000" }, { "id": "431226", "author": { "name": "perdona", "key": "perdona", "displayName": "Caio Perdona", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Just tested and it seems to work fine without any errors...\r\nHuge thanks to Hans for providing support on this issue!", "updateAuthor": { "name": "perdona", "key": "perdona", "displayName": "Caio Perdona", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-23T17:26:46.000+0000", "updated": "2017-11-23T17:26:46.000+0000" } ], "maxResults": 11, "total": 11, "startAt": 0 } } }