0

It's a hybrid Vordova based app. Trying to click a picture and show a thumbnail. It works on most devices, but this particular model of Samsung A03 does not work. Did multiple software updates and have reached the latest Android 13 and it still doesn't work.

In adb logcat below error is present. In chrome inspect it simply says No Image Selected.

MediaProvider: java.lang.IllegalArgumentException: Primary directory null not allowed for content://media/external_primary/file; allowed directories are [Download, Documents]

I have seen many answers related to changes in Android 11/12/13 permission set ups. However, it works fine on many other Android 10/11/12/13 devices.

Any idea what this could be?

Tried to add the permissions for READ_MEDIA_IMAGES in the Android Manifest XML file. This did not help. The app targets SDK 32 and min SDK 22 as required by Google. This issue is in the new build target SDK 32 and with updated plugins.
With the old builds targeting Android 28,29, the app is working fine on this device.

greybeard
  • 2,249
  • 8
  • 30
  • 66
Aqua
  • 1
  • Does this answer your question? [Android 11: Primary directory (invalid) not allowed for content://media/external/file allowed directories are \[Download, Documents\]](https://stackoverflow.com/questions/67367047/android-11-primary-directory-invalid-not-allowed-for-content-media-external) – Eric May 08 '23 at 17:37
  • Hello, I had gone through this and it did not help. Basically, I just figured out this issue. – Aqua May 10 '23 at 07:44

1 Answers1

0

After debugging the Java files in Android Studio, realised that RESULTCODE from activity returned 0 always. Searched with this and got a clue. Had recently change the AndroidLaunchMode to singleInstance instead of singleTask inorder for local notifications to work. Reverting this resolved the issue.

The directory related errors in the adb logcat appears to be misleading, right :/

Also the issue was only for a specific samsung device (irrespective of android version) and all others seemed fine. Related to chipset used?

Aqua
  • 1