{ "id": "119314", "key": "TIMOB-15829", "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": "20432", "name": "Release 8.0.1", "archived": false, "released": true, "releaseDate": "2019-05-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2019-04-29T14:54:32.000+0000", "created": "2013-08-30T15:15:06.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "SupportTeam", "android", "progressindicator", "reprod" ], "versions": [ { "id": "15478", "description": "Release 3.1.1", "name": "Release 3.1.1", "archived": true, "released": true, "releaseDate": "2013-06-17" } ], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2019-04-29T14:54:32.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 you call {{hide()}} twice on a {{ProgressIndicator}} *positioned in the status bar* the next time you call {{show()}} it will crash. Why I call {{hide()}} twice? Because multiple independent processes share a single (indeterminant) {{ProgressIndicator}} and call {{hide()}} not (needing) knowing what the others did before him.\r\n\r\nh1. Steps to reproduce\r\n\r\n# Create an app: {{titanium create -p android -n testProgress --id test.progress}}\r\n# Use the following code for {{app.js}}:\r\n {code}\r\n Ti.UI.backgroundColor = 'white';\r\n\r\n var win = Ti.UI.createWindow({\r\n backgroundColor: 'blue'\r\n });\r\n\r\n var button = Ti.UI.createButton({\r\n title: 'Show Progress Dialog'\r\n });\r\n\r\n var progressIndicator = Ti.UI.Android.createProgressIndicator({\r\n message: 'Loading...',\r\n location: Ti.UI.Android.PROGRESS_INDICATOR_STATUS_BAR,\r\n type: Ti.UI.Android.PROGRESS_INDICATOR_DETERMINANT,\r\n cancelable: true,\r\n min: 0,\r\n max: 10\r\n });\r\n\r\n button.addEventListener('click', function (e) {\r\n progressIndicator.show();\r\n var value = 0;\r\n setInterval(function(){\r\n if (value > 10) {\r\n return;\r\n }\r\n progressIndicator.value = value;\r\n value ++;\r\n }, 200);\r\n // do some work that takes 3 seconds\r\n // ie. replace the following setTimeout block with your code\r\n setTimeout(function(){\r\n progressIndicator.hide();\r\n progressIndicator.hide();\r\n }, 3000);\r\n });\r\n\r\n win.add(button);\r\n win.open();\r\n {code}\r\n# Build it to a device: {{titanium build -p android -T device}}\r\n# Press the button and wait for the progress indicator to finish\r\n# Press the button again and watch the app crash and spit out the following log:\r\n {code}\r\n09-10 20:50:13.027: E/TiApplication(5497): (main) [10239,10239] Sending event: exception on thread: main msg:java.lang.NullPointerException; Titanium 3.1.3,2013/09/08 09:51,b8f209a\r\n 09-10 20:50:13.027: E/TiApplication(5497): java.lang.NullPointerException\r\n 09-10 20:50:13.027: E/TiApplication(5497): at ti.modules.titanium.ui.widget.TiUIProgressIndicator.handleShow(TiUIProgressIndicator.java:187)\r\n 09-10 20:50:13.027: E/TiApplication(5497): at ti.modules.titanium.ui.widget.TiUIProgressIndicator.show(TiUIProgressIndicator.java:144)\r\n 09-10 20:50:13.027: E/TiApplication(5497): at ti.modules.titanium.ui.android.ProgressIndicatorProxy.handleShow(ProgressIndicatorProxy.java:62)\r\n 09-10 20:50:13.027: E/TiApplication(5497): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:233)\r\n 09-10 20:50:13.027: E/TiApplication(5497): at android.os.Handler.dispatchMessage(Handler.java:95)\r\n 09-10 20:50:13.027: E/TiApplication(5497): at android.os.Looper.loop(Looper.java:137)\r\n 09-10 20:50:13.027: E/TiApplication(5497): at android.app.ActivityThread.main(ActivityThread.java:4921)\r\n 09-10 20:50:13.027: E/TiApplication(5497): at java.lang.reflect.Method.invokeNative(Native Method)\r\n 09-10 20:50:13.027: E/TiApplication(5497): at java.lang.reflect.Method.invoke(Method.java:511)\r\n 09-10 20:50:13.027: E/TiApplication(5497): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)\r\n 09-10 20:50:13.027: E/TiApplication(5497): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)\r\n 09-10 20:50:13.027: E/TiApplication(5497): at dalvik.system.NativeStart.main(Native Method)\r\n 09-10 20:50:13.082: E/AndroidRuntime(5497): FATAL EXCEPTION: main\r\n 09-10 20:50:13.082: E/AndroidRuntime(5497): java.lang.NullPointerException\r\n 09-10 20:50:13.082: E/AndroidRuntime(5497): at ti.modules.titanium.ui.widget.TiUIProgressIndicator.handleShow(TiUIProgressIndicator.java:187)\r\n 09-10 20:50:13.082: E/AndroidRuntime(5497): at ti.modules.titanium.ui.widget.TiUIProgressIndicator.show(TiUIProgressIndicator.java:144)\r\n 09-10 20:50:13.082: E/AndroidRuntime(5497): at ti.modules.titanium.ui.android.ProgressIndicatorProxy.handleShow(ProgressIndicatorProxy.java:62)\r\n 09-10 20:50:13.082: E/AndroidRuntime(5497): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:233)\r\n 09-10 20:50:13.082: E/AndroidRuntime(5497): at android.os.Handler.dispatchMessage(Handler.java:95)\r\n 09-10 20:50:13.082: E/AndroidRuntime(5497): at android.os.Looper.loop(Looper.java:137)\r\n 09-10 20:50:13.082: E/AndroidRuntime(5497): at android.app.ActivityThread.main(ActivityThread.java:4921)\r\n 09-10 20:50:13.082: E/AndroidRuntime(5497): at java.lang.reflect.Method.invokeNative(Native Method)\r\n 09-10 20:50:13.082: E/AndroidRuntime(5497): at java.lang.reflect.Method.invoke(Method.java:511)\r\n 09-10 20:50:13.082: E/AndroidRuntime(5497): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)\r\n 09-10 20:50:13.082: E/AndroidRuntime(5497): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)\r\n 09-10 20:50:13.082: E/AndroidRuntime(5497): at dalvik.system.NativeStart.main(Native Method)\r\n {code}", "attachment": [], "flagged": false, "summary": "Android: Calling Ti.UI.Android.ProgressIndicator.hide() twice crashes app on next show()", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "SDK 3.1.1.GA\r\nAndroid 4.1.2 on Samsung Galaxy S2", "closedSprints": [ { "id": 1124, "state": "closed", "name": "2019 Sprint 8", "startDate": "2019-03-31T18:03:00.000Z", "endDate": "2019-04-12T18:03:00.000Z", "completeDate": "2019-04-12T19:04:50.175Z", "originBoardId": 114 }, { "id": 1128, "state": "closed", "name": "2019 Sprint 9", "startDate": "2019-04-14T19:05:00.000Z", "endDate": "2019-04-26T19:05:00.000Z", "completeDate": "2019-04-26T22:05:13.933Z", "originBoardId": 114 }, { "id": 1129, "state": "closed", "name": "2019 Sprint 10", "startDate": "2019-04-28T22:06:00.000Z", "endDate": "2019-05-17T22:06:00.000Z", "completeDate": "2019-05-20T16:48:42.522Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "270501", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Tried this:\n\n\n~~~\nTi.UI.backgroundColor = 'white';\n\nvar win = Ti.UI.createWindow({\n backgroundColor: 'blue'\n});\n\nvar button = Ti.UI.createButton({\n title: 'Show Progress Dialog'\n});\n\nvar progressIndicator = Ti.UI.Android.createProgressIndicator({\n message: 'Loading...',\n location: Ti.UI.Android.PROGRESS_INDICATOR_DIALOG,\n type: Ti.UI.Android.PROGRESS_INDICATOR_DETERMINANT,\n cancelable: true,\n min: 0,\n max: 10\n});\n\nbutton.addEventListener('click', function (e) {\n progressIndicator.show();\n var value = 0;\n setInterval(function(){\n if (value > 10) {\n return;\n }\n progressIndicator.value = value;\n value ++;\n }, 200);\n // do some work that takes 3 seconds\n // ie. replace the following setTimeout block with your code\n setTimeout(function(){\n progressIndicator.hide();\n progressIndicator.hide();\n }, 5000);\n});\n\nwin.add(button);\nwin.open();\n~~~\n\ndidn't crash or complain. Tested in Nexus 4, Android OS 4.3\n\nBest,\n\nMauro", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2013-09-10T00:28:02.000+0000", "updated": "2013-09-10T00:28:02.000+0000" }, { "id": "270644", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "[~mpmiranda], did you even read the steps I laid out? The code you use does not locate the progressIndicator in the status bar and does not call {{hide()}} twice before calling {{show()}} again.\n\nI've updated the steps, including the exact code and crash logs.\n\nWhy call {{hide()}} twice? Because it shouldn't be a problem firs of all, but also because often (in my humble experience) a progress indicator is used by several processes each able to hide/show it independent of each other. They shouldn't not need to keep track of the current state.", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2013-09-10T18:52:31.000+0000", "updated": "2013-09-10T18:52:31.000+0000" }, { "id": "281362", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "[~mpmiranda] Why just close this issue without even taking the effort of responding to my comment?", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2013-11-26T06:49:43.000+0000", "updated": "2013-11-26T06:49:43.000+0000" }, { "id": "281412", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Hello Fokke! \n\nI haven't been able to reproduce this in my personal device. I will try to find a S2 in the office, so I can test this in the same device than you. \n\nThanks for your help, \n\nMauro ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2013-11-26T15:09:25.000+0000", "updated": "2013-11-26T15:09:25.000+0000" }, { "id": "423932", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "I am able to reproduce this issue with the following environment;\r\nPixel (7.1)\r\nStudio 4.9.0.201705302345\r\nTi SDK 6.1.1 GA\r\nAppc NPM 4.2.9\r\nAppc CLI 6.2.2\r\nTi CLI 5.0.14\r\nAlloy 1.9.11\r\nXcode 8.2 (8C38)\r\nNode v4.8.2\r\nJava 1.8.0_131\r\n\r\nThis is the error I see;\r\n[WARN] : W/System.err: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.String java.lang.CharSequence.toString()' on a null object reference\r\n[WARN] : W/System.err: \tat ti.modules.titanium.ui.widget.TiUIProgressIndicator.handleShow(TiUIProgressIndicator.java:189)\r\n[WARN] : W/System.err: \tat ti.modules.titanium.ui.widget.TiUIProgressIndicator.show(TiUIProgressIndicator.java:146)\r\n[WARN] : W/System.err: \tat ti.modules.titanium.ui.android.ProgressIndicatorProxy.handleShow(ProgressIndicatorProxy.java:57)\r\n[WARN] : W/System.err: \tat org.appcelerator.titanium.proxy.TiViewProxy.show(TiViewProxy.java:788)\r\n[WARN] : W/System.err: \tat ti.modules.titanium.ui.TiDialogProxy.access$001(TiDialogProxy.java:22)\r\n[WARN] : W/System.err: \tat ti.modules.titanium.ui.TiDialogProxy$1.onCurrentActivityReady(TiDialogProxy.java:40)\r\n[WARN] : W/System.err: \tat org.appcelerator.titanium.util.TiUIHelper.waitForCurrentActivity(TiUIHelper.java:186)\r\n[WARN] : W/System.err: \tat ti.modules.titanium.ui.TiDialogProxy.show(TiDialogProxy.java:35)\r\n[WARN] : W/System.err: \tat org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method)\r\n[WARN] : W/System.err: \tat org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62)\r\n[WARN] : W/System.err: \tat org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:872)\r\n[WARN] : W/System.err: \tat org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1095)\r\n[WARN] : W/System.err: \tat org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:360)\r\n[WARN] : W/System.err: \tat android.os.Handler.dispatchMessage(Handler.java:98)\r\n[WARN] : W/System.err: \tat android.os.Looper.loop(Looper.java:154)\r\n[WARN] : W/System.err: \tat android.app.ActivityThread.main(ActivityThread.java:6119)\r\n[WARN] : W/System.err: \tat java.lang.reflect.Method.invoke(Native Method)\r\n[WARN] : W/System.err: \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)\r\n[WARN] : W/System.err: \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)\r\n[ERROR] : TiExceptionHandler: (main) [37883,37883] ----- Titanium Javascript Runtime Error -----\r\n[ERROR] : TiExceptionHandler: (main) [1,37884] - In /app.js:21,25\r\n[ERROR] : TiExceptionHandler: (main) [0,37884] - Message: Uncaught Attempt to invoke interface method 'java.lang.String java.lang.CharSequence.toString()' on a null object reference\r\n[ERROR] : TiExceptionHandler: (main) [0,37884] - Source: progressIndicator.show();\r\n[ERROR] : V8Exception: Exception occurred at /app.js:21: Uncaught Attempt to invoke interface method 'java.lang.String java.lang.CharSequence.toString()' on a null object reference\r\n[ERROR] : V8Exception: Attempt to invoke interface method 'java.lang.String java.lang.CharSequence.toString()' on a null object reference", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-07-11T18:03:48.000+0000", "updated": "2017-07-11T18:03:48.000+0000" }, { "id": "447640", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/10829", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-04-12T02:05:32.000+0000", "updated": "2019-04-12T02:05:32.000+0000" }, { "id": "447998", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (8.0.x): https://github.com/appcelerator/titanium_mobile/pull/10868", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-04-26T22:32:22.000+0000", "updated": "2019-04-26T22:32:22.000+0000" }, { "id": "448008", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR passed PR merged.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-04-26T23:19:07.000+0000", "updated": "2019-04-26T23:19:07.000+0000" }, { "id": "448041", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket, fix verified in SDK version 8.0.1.v20190426162041 and SDK version 8.1.0.v20190426222341.\r\n\r\nTest and other information can be found at: \r\nMaster : https://github.com/appcelerator/titanium_mobile/pull/10829\r\n8_0_X: https://github.com/appcelerator/titanium_mobile/pull/10868\r\n\r\n", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-04-29T14:54:24.000+0000", "updated": "2019-04-29T14:54:24.000+0000" } ], "maxResults": 14, "total": 14, "startAt": 0 } } }