{ "id": "170232", "key": "TIMOB-25529", "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": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-12-11T19:58:53.000+0000", "created": "2017-11-06T18:34:53.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "CloudPush", "android" ], "versions": [], "issuelinks": [ { "id": "56129", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "169882", "key": "NATIVESDK-353", "fields": { "summary": "Android: Unable to play custom sound for notifications on Android 7+", "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": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-12-11T19:58:53.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": [], "description": "*Hello everyone,\r\n\r\nWe have recently came across this bug. When custom sound used in Android the app crashes and the device stops receiving notifications.\r\n\r\nDo you have any solution on that matter? Thank you in advance!*\r\n\r\n\r\n[ERROR] : TiApplication: (main) [10869,132969] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start receiver com.appcelerator.aps.GCMReceiver: android.os.FileUriExposedException: link/RM.wav exposed beyond app through Notification.sound; Titanium 6.3.0,2017/10/31 18:13,undefined\r\n\r\n[ERROR] : TiApplication: java.lang.RuntimeException: Unable to start receiver com.appcelerator.aps.GCMReceiver: android.os.FileUriExposedException: link/RM.wav exposed beyond app through Notification.sound\r\n\r\n[ERROR] : TiApplication: at android.app.ActivityThread.handleReceiver(ActivityThread.java:3060)\r\n\r\n[ERROR] : TiApplication: at android.app.ActivityThread.-wrap18(ActivityThread.java)\r\n\r\n[ERROR] : TiApplication: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1584)\r\n\r\n[ERROR] : TiApplication: at android.os.Handler.dispatchMessage(Handler.java:102)\r\n\r\n[ERROR] : TiApplication: at android.os.Looper.loop(Looper.java:160)\r\n\r\n[ERROR] : TiApplication: at android.app.ActivityThread.main(ActivityThread.java:6200)\r\n\r\n[ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Native Method)\r\n\r\n[ERROR] : TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:874)\r\n\r\n[ERROR] : TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:764)\r\n\r\n[ERROR] : TiApplication: Caused by: android.os.FileUriExposedException: link/RM.wav exposed beyond app through Notification.sound\r\n\r\n[ERROR] : TiApplication: at android.os.StrictMode.onFileUriExposed(StrictMode.java:1799)\r\n\r\n[ERROR] : TiApplication: at android.net.Uri.checkFileUriExposed(Uri.java:2346)\r\n\r\n[ERROR] : TiApplication: at android.app.NotificationManager.notifyAsUser(NotificationManager.java:300)\r\n\r\n[ERROR] : TiApplication: at android.app.NotificationManager.notify(NotificationManager.java:284)\r\n\r\n[ERROR] : TiApplication: at android.app.NotificationManager.notify(NotificationManager.java:268)\r\n\r\n[ERROR] : TiApplication: at com.appcelerator.aps.APSCloudPush.showTrayNotification(APSCloudPush.java:523)\r\n\r\n[ERROR] : TiApplication: at com.appcelerator.aps.APSCloudPush.receivePayload(APSCloudPush.java:253)\r\n\r\n[ERROR] : TiApplication: at com.appcelerator.aps.GCMReceiver.onReceive(GCMReceiver.java:30)\r\n\r\n[ERROR] : TiApplication: at android.app.ActivityThread.handleReceiver(ActivityThread.java:3053)\r\n\r\n[ERROR] : TiApplication: ... 8 more", "attachment": [], "flagged": false, "summary": "Android: When custom sound is used the app crashes and the device stops receiving notifications", "creator": { "name": "andreas.pingas", "key": "andreas.pingas", "displayName": "Andreas Pingas", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "andreas.pingas", "key": "andreas.pingas", "displayName": "Andreas Pingas", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "430204", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello [~andreas.pingas],\r\n Thanks for sharing with us.Please create a full reproducible test code and provide here for us to test the issue. Also, provide detail affected environment. \r\nThanks.", "updateAuthor": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2017-11-07T04:58:25.000+0000", "updated": "2017-11-07T04:58:25.000+0000" }, { "id": "430237", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~andreas.pingas], this is a known issue that happens on Android 7.0 and newer OS versions. The issue is that if your app targets Android 7.0 (aka: API Level 24) or higher, then we need to grant read permissions to external apps (the OS' NotificationManager in this case) to read your app's sandboxed files (the custom sound file). But unfortunately, this is kind of a design issue on Google's end (see link below) because there isn't a way to solve this without making an \"assumption\" regarding which background process name needs access to your custom sound file, which isn't a 100% full proof solution. Especially considering the Android forks that exist in the wild.\r\nhttps://issuetracker.google.com/issues/37118905\r\n\r\nFor the moment, you can work-around this issue by targeting API Level 23 or lower in your \"tiapp.xml\" file.\r\n\r\n{code:xml}\r\n\r\n\t\r\n\t\t\r\n\t\r\n\r\n{code}\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-07T19:03:12.000+0000", "updated": "2017-11-07T19:03:12.000+0000" }, { "id": "430338", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello [~andreas.pingas],\r\n\r\nDid you manage to follow [~jquick]'s instructions?\r\n\r\nBest", "updateAuthor": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2017-11-09T04:15:35.000+0000", "updated": "2017-11-09T04:15:35.000+0000" }, { "id": "430446", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello [~andreas.pingas], please get back to us on on the workaround that Joshua provided. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2017-11-11T16:44:06.000+0000", "updated": "2017-11-11T16:47:52.000+0000" }, { "id": "430541", "author": { "name": "andreas.pingas", "key": "andreas.pingas", "displayName": "Andreas Pingas", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I have used targetSdkVersion 25. There is no issue on targetSdkVersion 23. We have removed the custom sounds.\r\n\r\nIf i use targetSdkVersion 23\r\n\r\nI get the following:\r\n\r\n[ERROR] : The target SDK API 23 is not supported by Titanium SDK 6.3.0\r\nUpdate the android:targetSdkVersion in the tiapp.xml or custom AndroidManifest to at least 25:\r\n[ERROR] : The target SDK API version must be 25 or newer\r\n\r\n \r\n \r\n \r\n \r\n \r\n\r\n[ERROR] Application Installer abnormal process termination. Process exit value was 1\r\n\r\ntargetSdkVersion 23 is not supported from SDK 6.3.0. It is stated that it supports 23-26 but only 25-26 it is supported.", "updateAuthor": { "name": "andreas.pingas", "key": "andreas.pingas", "displayName": "Andreas Pingas", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-13T20:17:15.000+0000", "updated": "2017-11-13T20:17:15.000+0000" }, { "id": "430545", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~andreas.pingas],\r\n\r\nOh shoot, you're right. The min target API Level is 25 on Titanium 6.2.2 and above.\r\nTitanium 6.2.1 can be set to API Level 23.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-13T21:29:56.000+0000", "updated": "2017-11-13T21:29:56.000+0000" }, { "id": "430580", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~jquick] Can we add the Android bug-report link and a short note to the related docs as well? It might help people getting rid of that issue more easily.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-11-14T08:20:49.000+0000", "updated": "2017-11-14T08:20:49.000+0000" }, { "id": "430863", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~andreas.pingas], [~hknoechel],\r\n\r\nWe're looking into resolving this custom notification sound issue by the time Titanium 7.0.0. gets released.\r\nAlso, in Titanium 7.0.0, we're lowering the min target API Level from 25 to 23 as well.\r\nStay tuned!", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-16T22:43:53.000+0000", "updated": "2017-11-16T22:43:53.000+0000" }, { "id": "431980", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This was resolved in 7.0.0.\r\nSorry, there was a duplicate ticket on this issue [NATIVESDK-353] and it was closed instead.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-12-11T19:57:59.000+0000", "updated": "2017-12-11T19:57:59.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }