Hi all, I’m trying to use the Screenshot component from Utilities, but it isn’t working and saying WRITE_EXTERNAL_STORAGE permission isn’t granted and I need to enable it within settings when trying to run the “Screenshot1.takescreenshot” method. I have an Android 12 Samsung Galaxy A50 (2019) and am testing on a downloaded APK.
I’ve tried the custom manifest extension for read and write permissions by @bodymindpower (not working for some reason), setting the permissions for READ & WRITE beforehand (but WRITE is still giving the same error) and am unable to see WRITE permission specifically in settings.
I’ve read a ton of posts around this issue, almost everyone says this is a known issue since long - I just wanted to ask if there’s a workaround for this yet and how do I make the screenshot component work… Can anyone share any advice on this? Thanks.
The component had set “Screenshot.png” as the filename property in designer by default. Now i’ve removed it from designer and am setting it to “/Download/myScreenshot.jpg” right before TakeScreenshot method. Here are my complete updated blocks.
Everything seems to work in Live Companion; I freshly installed the companion and checked, it just one-time asks for “access photos and media” permission on the “badges” screen (pic below) as the TakeScreenshot method is about to run, nothing else; and then takes the screenshot and runs later code as expected.
But when I install as apk on other one of my device which is an android 11 one, same as companion it asks for the above permission on the “badge” screen, but then says WRITE_EXTERNAL_STORAGE permission denied. Is it possible to fix this? If not does this mean we can’t use the screenshot component on apps on Android 11+ phones? Also just curious, why is this working on companion but not on installed app? The companion would need the external storage permission too right? Please advice… Thanks!
This is another bug in Kodular, because the Screenshot component incorrectly requests WRITE permission for the ASD as well (on Android 11+).
However, in Kodular there is no other way than manually declaring WRITE permission in the Manifest also for Android 11+. In AI2 this is possible by setting DefaultFileScope = Legacy, which also makes no sense because WRITE permission no longer exists on Android 11+. (All pointed out dozens of times, including AI2).
PS: I very rarely post anything on Kodular anymore. However, since there is supposed to be a collaboration (a merger) between Kodular and AI2, I’ll point out bugs as a precaution, as I’ve been doing for years on the side.