In my project, I have an app module with instrumentation tests.
They use code from a library module which needs additional permissions that should normally not be included in the app. (WRITE_EXTERNAL_STORAGE)
I have put the permission in the libraries manifest and included it in the apps build.gradle using androidTestImplementation
.
Unfortunately when I run the test it fails because the manifest of the installed application does not contain the required permission.
I also tried writing to context.filesDir
since that should not require any permission, but it also fails with "Permission denied"
How can my library code write to the file system without the app module manifest having to include the permission?