{ "id": "172424", "key": "TIMOB-26624", "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": null, "resolutiondate": null, "created": "2018-10-11T13:02:04.000+0000", "priority": null, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2018-12-03T14:35:28.000+0000", "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" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "I'm trying to create a recurrent event for Android. It does seem to work partially, but weekly events never work and I do get an error. If I use the example code, I get the following error in the console log:\r\n\r\n{code:java}\r\n[ERROR] EventProxy: (main) [360,128859] Invalid event recurrence rule.\r\n[ERROR] EventProxy: (main) [0,128859] java.lang.IllegalArgumentException: Invalid recurrence rule: FREQ=WEEKLY;BYDAY=;INTERVAL=1;\r\n[ERROR] EventProxy: (main) [0,128859] Invalid event recurrence rule.\r\n{code}\r\n\r\nThe example code:\r\n\r\n{code:java}\r\nfunction performCalendarWriteFunctions() {\r\n if (!Ti.Calendar.allCalendars) {\r\n console.error('no calendars found!');\r\n return;\r\n }\r\n\r\n var defCalendar = Ti.Calendar.allCalendars[0];\r\n \r\n var date1 = new Date(new Date().getTime() + 3000),\r\n date2 = new Date(new Date().getTime() + 900000);\r\n \r\n var event1 = defCalendar.createEvent({\r\n title: 'Sample Event',\r\n begin: date1,\r\n end: date2\r\n });\r\n \r\n var newRule = event1.createRecurrenceRule({\r\n frequency: Ti.Calendar.RECURRENCEFREQUENCY_WEEKLY,\r\n interval: 1\r\n }); \r\n \r\n event1.recurrenceRules = [newRule];\r\n event1.save();\r\n}\r\n \r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: 'white',\r\n title: 'Calendar Demo'\r\n});\r\n \r\nwin.addEventListener('open', function () {\r\n if (Ti.Calendar.hasCalendarPermissions()) {\r\n performCalendarWriteFunctions();\r\n } else {\r\n Ti.Calendar.requestCalendarPermissions(function (e) {\r\n if (e.success) {\r\n performCalendarWriteFunctions();\r\n } else {\r\n alert('Access to calendar is not allowed');\r\n }\r\n });\r\n }\r\n});\r\n \r\nwin.open();\r\n{code}\r\n\r\nAlso according to the docs the daysOfWeek array should look like:\r\n\r\n{code:java}\r\n[{dayOfWeek:1,week:2},{dayOfWeek:2}]\r\n{code}\r\n\r\nBut the Android part expects:\r\n\r\n{code:java}\r\n[{daysOfWeek:1,week:2},{daysOfWeek:2}]\r\n{code}\r\n\r\nThis also gives an invalid recurrence rule: FREQ=WEEKLY;BYDAY=1,2,;INTERVAL=1;\r\n\r\n", "attachment": [], "flagged": false, "summary": "Android: Can't create calendar event with recurrence rule", "creator": { "name": "teunklijn@telfort.nl", "key": "teunklijn@telfort.nl", "displayName": "Teun Klijn", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "teunklijn@telfort.nl", "key": "teunklijn@telfort.nl", "displayName": "Teun Klijn", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "Android 8.0, 7.4.0.GA", "comment": { "comments": [ { "id": "444034", "author": { "name": "jnaher", "key": "jnaher", "displayName": "Jebun Naher", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hi [~teunklijn@telfort.nl], \r\nCan you please verify the issue on latest ti sdk 7.5.0.GA and let us know how it goes. It would be helpful if you can share your complete console log, test steps to reproduce this and your environment details here.\r\n\r\nThanks!", "updateAuthor": { "name": "jnaher", "key": "jnaher", "displayName": "Jebun Naher", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2018-11-29T06:16:42.000+0000", "updated": "2018-11-29T06:16:42.000+0000" }, { "id": "444041", "author": { "name": "teunklijn@telfort.nl", "key": "teunklijn@telfort.nl", "displayName": "Teun Klijn", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Hi [~jnaher],\r\n\r\nYes the error still occurs on 7.5.0.GA. You can reproduce the error by running the sample above, in the log you will see the error. Also as you can see in the code above I schedule a notification in 3 seconds, but that never arrives. \r\n\r\nTo get the full error above (java.lang.IllegalArgumentException: Invalid recurrence rule: FREQ=WEEKLY;BYDAY=;INTERVAL=1; ) I edited the Titanium source to log a more detailed error, so you won't see that in your own logs.\r\n\r\nMy log:\r\n\r\n{code:java}\r\n[WARN] zygote: Unexpected CPU variant for X86 using defaults: x86\r\n[INFO] TiApplication: (main) [0,0] checkpoint, app created.\r\n[INFO] MultiDex: VM with version 2.1.0 has multidex support\r\n[INFO] MultiDex: Installing application\r\n[INFO] MultiDex: VM has multidex support, MultiDex support library is disabled.\r\n[INFO] TiApplication: (main) [40,40] Analytics have been disabled\r\n[INFO] TiApplication: (main) [756,796] Titanium Javascript runtime: v8\r\n[INFO] TiRootActivity: (main) [0,0] checkpoint, on root activity create, savedInstanceState: null\r\n[INFO] TestProject 1.0 (Powered by Titanium 7.5.0.2e5a7423d0)\r\n[INFO] TiApplication: (main) [118,118] Analytics have been disabled\r\n[INFO] TiRootActivity: (main) [0,0] checkpoint, on root activity resume. activity = [projectid].TestprojectActivity@515b844\r\n[DEBUG] OpenGLRenderer: HWUI GL Pipeline\r\n[DEBUG] Window: Checkpoint: postWindowCreated()\r\n[ERROR] EventProxy: (main) [89,89] Invalid event recurrence rule.\r\n[DEBUG] D/ : HostConnection::get() New Host Connection established 0xa1372240, tid 9974\r\n[INFO] OpenGLRenderer: Initialized EGL, version 1.4\r\n[DEBUG] OpenGLRenderer: Swap behavior 1\r\n[WARN] OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...\r\n[DEBUG] OpenGLRenderer: Swap behavior 0\r\n[DEBUG] EGL_emulation: eglCreateContext: 0xa3c84420: maj 3 min 0 rcv 3\r\n[DEBUG] EGL_emulation: eglMakeCurrent: 0xa3c84420: ver 3 0 (tinfo 0xa3c83310)\r\n[ERROR] eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf\r\n[ERROR] eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf\r\n[ERROR] eglCodecCommon: glUtilsParamSize: unknow param 0x00008824\r\n[ERROR] eglCodecCommon: glUtilsParamSize: unknow param 0x00008824\r\n[DEBUG] EGL_emulation: eglMakeCurrent: 0xa3c84420: ver 3 0 (tinfo 0xa3c83310)\r\n[TRACE] updating tiapp metadata with Appcelerator Platform...\r\n[TRACE] Uploaded tiapp metadata with Appcelerator Platform!\r\n{code}\r\n\r\nMy environment is:\r\n* MacOS 10.13.6 (High Sierra)\r\n* Android Emulator 8.0.0\r\n* SDK 7.5.0.GA\r\n* Appcelerator CLI 7.0.7\r\n* NPM 4.2.13\r\n", "updateAuthor": { "name": "teunklijn@telfort.nl", "key": "teunklijn@telfort.nl", "displayName": "Teun Klijn", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2018-11-29T08:14:19.000+0000", "updated": "2018-11-29T08:16:16.000+0000" }, { "id": "444116", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, There is problem with the sample code provided, I got \r\n{code}\r\n[ERROR] TiExceptionHandler: (main) [332,332] /app.js:2\r\n[ERROR] TiExceptionHandler: var defCalendar = _.find(Ti.Calendar.allCalendars, function (cal, i) {\r\n[ERROR] TiExceptionHandler: ^\r\n[ERROR] TiExceptionHandler: ReferenceError: _ is not defined\r\n[ERROR] TiExceptionHandler: at performCalendarWriteFunctions (/app.js:2:21)\r\n[ERROR] TiExceptionHandler: at Window. (/app.js:31:5)\r\n[ERROR] TiExceptionHandler: at Window.value (ti:/events.js:49:21)\r\n[ERROR] TiExceptionHandler: at Window.value (ti:/events.js:101:19)\r\n{code}\r\nin SDK 7.4.1.GA.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2018-12-01T10:58:36.000+0000", "updated": "2018-12-01T10:58:36.000+0000" }, { "id": "444117", "author": { "name": "teunklijn@telfort.nl", "key": "teunklijn@telfort.nl", "displayName": "Teun Klijn", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Hi [~sdarda],\r\n\r\nThat's weird, I think the underscore library should always be included in the Titanium SDK. I've edited the example code so that it doesn't use the underscore library anymore.", "updateAuthor": { "name": "teunklijn@telfort.nl", "key": "teunklijn@telfort.nl", "displayName": "Teun Klijn", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2018-12-01T11:14:41.000+0000", "updated": "2018-12-01T11:14:53.000+0000" }, { "id": "444119", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, Now I got the below error despite adding the permission on the tiapp.xml\r\n{code}\r\n[ERROR] TiExceptionHandler: (main) [227,227] /app.js:13\r\n[ERROR] TiExceptionHandler: var event1 = defCalendar.createEvent({\r\n[ERROR] TiExceptionHandler: ^\r\n[ERROR] TiExceptionHandler: TypeError: Cannot read property 'createEvent' of undefined\r\n[ERROR] TiExceptionHandler: at performCalendarWriteFunctions (/app.js:13:28)\r\n[ERROR] TiExceptionHandler: at Window. (/app.js:35:5)\r\n[ERROR] TiExceptionHandler: at Window.value (ti:/events.js:49:21)\r\n[ERROR] TiExceptionHandler: at Window.value (ti:/events.js:101:19)\r\n{code}\r\n", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2018-12-01T22:39:26.000+0000", "updated": "2018-12-01T22:39:26.000+0000" }, { "id": "444161", "author": { "name": "teunklijn@telfort.nl", "key": "teunklijn@telfort.nl", "displayName": "Teun Klijn", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Is there a editable calendar on your test device if not could you create one? Or should I edit the sample so that it creates a calendar?", "updateAuthor": { "name": "teunklijn@telfort.nl", "key": "teunklijn@telfort.nl", "displayName": "Teun Klijn", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2018-12-03T14:35:28.000+0000", "updated": "2018-12-03T14:35:28.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }