NativeScript / plugins

@nativescript plugins to help with your developments.
https://docs.nativescript.org/plugins/index.html
Apache License 2.0
189 stars 107 forks source link

[@nativescript/imagepicker] java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFFF #516

Open Bezlepkin opened 1 year ago

Bezlepkin commented 1 year ago

Hi! I try to get video from a gallery on Android, but getting an error: java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFFF

https://github.com/NativeScript/plugins/blob/main/packages/imagepicker/index.android.ts#LL259C24-L259C24

3rror404 commented 1 year ago

I'm also experiencing a similar error using the same versions as mentioned above, with the latest version of @nativescript/image-picker

  JS: CONSOLE LOG: Error ->  Error: java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA handle(file: app/webpack:/sentrysis/node_modules/@nativescript/imagepicker/index.android.js:247:0)
  JS:   at onResult(file: app/webpack:/sentrysis/node_modules/@nativescript/imagepicker/index.android.js:280:0)
  JS:   at _handleEvent(file: app/webpack:/sentrysis/node_modules/@nativescript/core/data/observable/index.js:306:0)
  JS:   at notify(file: app/webpack:/sentrysis/node_modules/@nativescript/core/data/observable/index.js:287:0)
  JS:   at onActivityResult(file: app/webpack:/sentrysis/node_modules/@nativescript/core/ui/frame/index.android.js:1142:19)
  JS:   at onActivityResult(file: app/webpack:/sentrysis/node_modules/@nativescript/core/ui/frame/activity.android.js:48:0)

Is there any workaround/fix for this?

Just tested Android 13 and it also throws the same error.

3rror404 commented 1 year ago

Workaround is to use the copyToAppFolder setting.

let context = imagePicker.create({
        mode: "multiple", 
        mediaType: 2,
        copyToAppFolder: 'temp-images'
    });