opentok / opentok-android-sdk-samples

Sample applications illustrating best practices using OpenTok Android SDK.
https://tokbox.com/developer/sdks/android/
MIT License
211 stars 169 forks source link

https://github.com/opentok/opentok-android-sdk-samples/tree/main/Live-Photo-Capture-Kotlin Not working with ANDROID 11 #408

Closed vonage-pposadas closed 2 years ago

vonage-pposadas commented 2 years ago

It gives permission denied errors when writing to the storage of the device. Discussed with Devrel team here in internal Vonage slack channel.

Please help fix the sample app for our customers.

21-12-06 12:17:50.102 22167-26636/com.tokbox.sample.livephotocapture A/libc: Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x71adc31000 in tid 26636 (GLThread 9898), pid 22167 (ivephotocapture) 2021-12-06 12:17:50.163 22167-26645/com.tokbox.sample.livephotocapture W/System.err: java.io.FileNotFoundException: /storage/emulated/0/opentok-capture-1638764270131.png: open failed: EPERM (Operation not permitted) 2021-12-06 12:17:50.163 22167-26645/com.tokbox.sample.livephotocapture W/System.err: at libcore.io.IoBridge.open(IoBridge.java:492) 2021-12-06 12:17:50.163 22167-26645/com.tokbox.sample.livephotocapture W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:236) 2021-12-06 12:17:50.163 22167-26645/com.tokbox.sample.livephotocapture W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:186) 2021-12-06 12:17:50.163 22167-26645/com.tokbox.sample.livephotocapture W/System.err: at com.tokbox.sample.livephotocapture.ScreenshotVideoRenderer$MyRenderer.displayFrame(ScreenshotVideoRenderer.kt:254) 2021-12-06 12:17:50.163 22167-26645/com.tokbox.sample.livephotocapture W/System.err: at com.tokbox.sample.livephotocapture.ScreenshotVideoRenderer.onFrame(ScreenshotVideoRenderer.kt:384) 2021-12-06 12:17:50.163 22167-26645/com.tokbox.sample.livephotocapture W/System.err: at com.opentok.android.SubscriberKit.onFrameJNI(Unknown Source:14) 2021-12-06 12:17:50.163 22167-26645/com.tokbox.sample.livephotocapture W/System.err: Caused by: android.system.ErrnoException: open failed: EPERM (Operation not permitted) 2021-12-06 12:17:50.163 22167-26645/com.tokbox.sample.livephotocapture W/System.err: at libcore.io.Linux.open(Native Method) 2021-12-06 12:17:50.163 22167-26645/com.tokbox.sample.livephotocapture W/System.err: at libcore.io.ForwardingOs.open(ForwardingOs.java:166) 2021-12-06 12:17:50.163 22167-26645/com.tokbox.sample.livephotocapture W/System.err: at libcore.io.BlockGuardOs.open(BlockGuardOs.java:254) 2021-12-06 12:17:50.163 22167-26645/com.tokbox.sample.livephotocapture W/System.err: at libcore.io.ForwardingOs.open(ForwardingOs.java:166) 2021-12-06 12:17:50.163 22167-26645/com.tokbox.sample.livephotocapture W/System.err: at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:8494) 2021-12-06 12:17:50.163 22167-26645/com.tokbox.sample.livephotocapture W/System.err: at libcore.io.IoBridge.open(IoBridge.java:478) 2021-12-06 12:17:50.163 22167-26645/com.tokbox.sample.livephotocapture W/System.err: ... 5 more

User's testing:

2021-12-06 20:48:50.023 18516-18970/com.tokbox.sample.livephotocapture W/System.err: java.io.FileNotFoundException: /storage/emulated/0/opentok-capture-1638803867684.png: open failed: EACCES (Permission denied) 2021-12-06 20:48:50.024 18516-18970/com.tokbox.sample.livephotocapture W/System.err: at libcore.io.IoBridge.open(IoBridge.java:496) 2021-12-06 20:48:50.025 18516-18970/com.tokbox.sample.livephotocapture W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:235) 2021-12-06 20:48:50.026 18516-18970/com.tokbox.sample.livephotocapture W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:186) 2021-12-06 20:48:50.027 18516-18970/com.tokbox.sample.livephotocapture W/System.err: at com.tokbox.sample.livephotocapture.ScreenshotVideoRenderer$MyRenderer.displayFrame(ScreenshotVideoRenderer.kt:255) 2021-12-06 20:48:50.028 18516-18970/com.tokbox.sample.livephotocapture W/System.err: at com.tokbox.sample.livephotocapture.ScreenshotVideoRenderer.onFrame(ScreenshotVideoRenderer.kt:387) 2021-12-06 20:48:50.031 18516-18970/com.tokbox.sample.livephotocapture W/System.err: at com.opentok.android.SubscriberKit.onFrameJNI(Unknown Source:14) 2021-12-06 20:48:50.036 18516-18970/com.tokbox.sample.livephotocapture W/System.err: Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied) 2021-12-06 20:48:50.037 18516-18970/com.tokbox.sample.livephotocapture W/System.err: at libcore.io.Linux.open(Native Method) 2021-12-06 20:48:50.038 18516-18970/com.tokbox.sample.livephotocapture W/System.err: at libcore.io.ForwardingOs.open(ForwardingOs.java:167) 2021-12-06 20:48:50.038 18516-18970/com.tokbox.sample.livephotocapture W/System.err: at libcore.io.BlockGuardOs.open(BlockGuardOs.java:252) 2021-12-06 20:48:50.039 18516-18970/com.tokbox.sample.livephotocapture W/System.err: at libcore.io.ForwardingOs.open(ForwardingOs.java:167) 2021-12-06 20:48:50.040 18516-18970/com.tokbox.sample.livephotocapture W/System.err: at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7296) 2021-12-06 20:48:50.040 18516-18970/com.tokbox.sample.livephotocapture W/System.err: at libcore.io.IoBridge.open(IoBridge.java:482) 2021-12-06 20:48:50.041 18516-18970/com.tokbox.sample.livephotocapture W/System.err: ... 5 more

v-kpheng commented 2 years ago

@vonage-pposadas, thanks for letting us know about this. We tested this recently and it worked, albeit on a newer version of Android.

Can you please try again? If the issue persists, please let us know. Thanks!