in some devices (especially in android 14) when i want to pick a media from gallery using PickVisualMediaRequest google play shows Something went wrong and i can't do anything.
This is the error: click to view error image
Here is my code to pick media:
ActivityResultLauncher<PickVisualMediaRequest> pickMedia =
registerForActivityResult(new ActivityResultContracts.PickVisualMedia(), new ActivityResultCallback<Uri>() {
@Override
public void onActivityResult(Uri uri) {
if (uri != null) {
// my stuff
}
}
});
pickMedia.launch(new PickVisualMediaRequest.Builder()
.setMediaType(ActivityResultContracts.PickVisualMedia.ImageOnly.INSTANCE)
.build());
NOTE: I use a single signature key in 3 of my apps.
I searched on Google, but I did not find any solution to my problem. also i tested on emulator with android 14 but it worked fine for me.