- Home /
Application crashes when taking screenshot on Android with API >28
Hello, I'm developing an application and I need to make a screenshot and use it as a texture instead of saving to file, when user clicks a button. It's application only for Android for now and that is when the application crashes.
I tried to use multiple solutions
ScreenCapture.CaptureScreenshotAsTexture
new Texture of a screen size and then apply it
plugin Capture and Save (Lite) https://assetstore.unity.com/packages/tools/integration/capture-and-save-lite-18755
All these solutions worked fine when I used API level 28 and lower, but Google Play wanted me to target API level 30. When I switched to API level 30 and uploaded to Google play, my testers started to report a crash, when they click the screenshot button. I tried to logcat this issue and got error (see image). I tried to google it for a while but I didn't find anything useful. I also attach the build settings screen.
I tried to replicate this error in an empty project, but it crashed only sometimes (with the same error). I appreciate any help, because the development of this app lasts for 3 years now and I really need to release it.
Thanks in advance!