I am trying this determinic screenshot library but always got Operation not permitted error when calling Screenshot.snapActivity(mActivity).setName(name).record(). Looks like I was able to create directory but not able to save the screenshot. Has anyone seen the same error?
I already put in AndroidManifest,
and my emulator is Pixel XL API 30.
java.lang.RuntimeException: java.lang.RuntimeException: java.io.IOException: Operation not permitted
at com.facebook.testing.screenshot.internal.ScreenshotImpl.runCallableOnUiThread(ScreenshotImpl.java:345)
at com.facebook.testing.screenshot.internal.ScreenshotImpl.storeBitmap(ScreenshotImpl.java:166)
at com.facebook.testing.screenshot.internal.ScreenshotImpl.record(ScreenshotImpl.java:270)
at com.facebook.testing.screenshot.internal.RecordBuilderImpl.record(RecordBuilderImpl.java:152)
...
Caused by: java.lang.RuntimeException: java.io.IOException: Operation not permitted
at com.facebook.testing.screenshot.internal.ScreenshotImpl.storeBitmap(ScreenshotImpl.java:199)
at com.facebook.testing.screenshot.internal.ScreenshotImpl.access$000(ScreenshotImpl.java:50)
at com.facebook.testing.screenshot.internal.ScreenshotImpl$2.call(ScreenshotImpl.java:170)
at com.facebook.testing.screenshot.internal.ScreenshotImpl$2.call(ScreenshotImpl.java:167)
at com.facebook.testing.screenshot.internal.ScreenshotImpl$3.run(ScreenshotImpl.java:327)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: java.io.IOException: Operation not permitted
at java.io.UnixFileSystem.createFileExclusively0(Native Method)
at java.io.UnixFileSystem.createFileExclusively(UnixFileSystem.java:317)
at java.io.File.createNewFile(File.java:1008)
at com.facebook.testing.screenshot.internal.AlbumImpl.getOrCreateZipOutputStream(AlbumImpl.java:67)
at com.facebook.testing.screenshot.internal.AlbumImpl.writeBitmap(AlbumImpl.java:183)
at com.facebook.testing.screenshot.internal.ScreenshotImpl.drawTile(ScreenshotImpl.java:235)
at com.facebook.testing.screenshot.internal.ScreenshotImpl.storeBitmap(ScreenshotImpl.java:195)
... 11 more
I am trying this determinic screenshot library but always got Operation not permitted error when calling Screenshot.snapActivity(mActivity).setName(name).record(). Looks like I was able to create directory but not able to save the screenshot. Has anyone seen the same error? I already put in AndroidManifest,
and my emulator is Pixel XL API 30.
java.lang.RuntimeException: java.lang.RuntimeException: java.io.IOException: Operation not permitted at com.facebook.testing.screenshot.internal.ScreenshotImpl.runCallableOnUiThread(ScreenshotImpl.java:345) at com.facebook.testing.screenshot.internal.ScreenshotImpl.storeBitmap(ScreenshotImpl.java:166) at com.facebook.testing.screenshot.internal.ScreenshotImpl.record(ScreenshotImpl.java:270) at com.facebook.testing.screenshot.internal.RecordBuilderImpl.record(RecordBuilderImpl.java:152) ... Caused by: java.lang.RuntimeException: java.io.IOException: Operation not permitted at com.facebook.testing.screenshot.internal.ScreenshotImpl.storeBitmap(ScreenshotImpl.java:199) at com.facebook.testing.screenshot.internal.ScreenshotImpl.access$000(ScreenshotImpl.java:50) at com.facebook.testing.screenshot.internal.ScreenshotImpl$2.call(ScreenshotImpl.java:170) at com.facebook.testing.screenshot.internal.ScreenshotImpl$2.call(ScreenshotImpl.java:167) at com.facebook.testing.screenshot.internal.ScreenshotImpl$3.run(ScreenshotImpl.java:327) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:223) at android.app.ActivityThread.main(ActivityThread.java:7656) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) Caused by: java.io.IOException: Operation not permitted at java.io.UnixFileSystem.createFileExclusively0(Native Method) at java.io.UnixFileSystem.createFileExclusively(UnixFileSystem.java:317) at java.io.File.createNewFile(File.java:1008) at com.facebook.testing.screenshot.internal.AlbumImpl.getOrCreateZipOutputStream(AlbumImpl.java:67) at com.facebook.testing.screenshot.internal.AlbumImpl.writeBitmap(AlbumImpl.java:183) at com.facebook.testing.screenshot.internal.ScreenshotImpl.drawTile(ScreenshotImpl.java:235) at com.facebook.testing.screenshot.internal.ScreenshotImpl.storeBitmap(ScreenshotImpl.java:195) ... 11 more