NativeScript / nativescript-imagepicker

Imagepicker plugin supporting both single and multiple selection.
Apache License 2.0
104 stars 74 forks source link

Can't set permisssions on Android 12 (can't authorize) [nativescript-imagepicker] #342

Closed YavorBorissov closed 7 months ago

YavorBorissov commented 7 months ago

Issue occurs on Android 12 Emulator device Pixel 8 (API 31)

What happens is when I select the device that runs Android 12 and click the button that should upload the image - nothing happens (authorization fails). I've tried it with Android 11, 13, and 14 and it works with no issues. As seen on the screenshot even when I go in settings I don't have the option to turn this particular permission on. (I'm also linking my github repo where the issue is replicated)

Screenshot 2024-04-05 172039

YavorBorissov commented 7 months ago

The issue was solved in the Nativescript discord group. Here's the thread ID for anyone interested 1226816239817723935.

Here was the solution provided:

In your AndroidManifest.xml change the uses-permission of these to include the restrictions:

 <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" tools:replace="android:maxSdkVersion" android:maxSdkVersion="32" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" tools:replace="android:maxSdkVersion" android:maxSdkVersion="32" />

adding xmlns:tools="http://schemas.android.com/tools" to the root element.

Huge thanks to jcassidyav on discord for helping out.