{ "id": "176189", "key": "TIMOB-28448", "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": "21199", "description": "", "name": "Release 10.0.1", "archived": false, "released": true, "releaseDate": "2021-07-28" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2021-05-24T15:35:49.000+0000", "created": "2021-05-14T13:17:13.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "error", "log", "notifications", "toast" ], "versions": [], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2021-05-24T15:35:49.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": "When showing a {{Ti.UI.Notification}}, the console always logs an error since a few Android versions (mostly noted since Android 11):\r\n{code}\r\n[ERROR] Toast: getHorizontalMargin() shouldn't be called on text toasts, the result may not reflect actual values.\r\n[ERROR] Toast: getVerticalMargin() shouldn't be called on text toasts, the result may not reflect actual values.\r\n[ERROR] Toast: getXOffset() shouldn't be called on text toasts, the result may not reflect actual values.\r\n[ERROR] Toast: getYOffset() shouldn't be called on text toasts, the result may not reflect actual values.\r\n[ERROR] Toast: getGravity() shouldn't be called on text toasts, the result may not reflect actual values.\r\n[ERROR] Toast: setMargin() shouldn't be called on text toasts, the values won't be used\r\n[ERROR] Toast: setGravity() shouldn't be called on text toasts, the values won't be used\r\n{code}\r\n\r\nThe issue can be fixed by guarding the related properties to only access them if we really want to override alignment, gravity or margins.\r\n\r\nTest case:\r\n{code:js}\r\nconst window = Ti.UI.createWindow();\r\nwindow.addEventListener('open', () => {\r\n Ti.UI.createNotification({\r\n title: 'Hello world',\r\n duration: Ti.UI.NOTIFICATION_DURATION_SHORT\r\n }).show();\r\n});\r\nwindow.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: Ti.UI.Notifications logs errors because of alignment, margins and gravity", "creator": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "458683", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/12815", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2021-05-14T13:20:03.000+0000", "updated": "2021-05-14T13:20:03.000+0000" }, { "id": "458705", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "merged to master and 10_0_X branch for 10.0.1 target", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2021-05-24T14:54:09.000+0000", "updated": "2021-05-24T14:54:09.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }