Friday, 12 July 2019

Cordova Diagnostic Exception on Diagnostic.getExternalSdCardDetails()

I have to read data from an SD card in a device.

I first try to do it via cordova-plugin-file, but it just show me file:///storage/emulated/0/ and not the sdcard directory.

I found out that I needed to use cordova.plugins.diagnostic to solve my problem, but when I use it (with Diagnostic.getExternalSdCardDetails().then(OnSucceedFunction, OnFailureFunction)*), it "work" on on web view (by send me the error cordova_not_available, but it's logic), but in android app, nothing append on the app, and I need to use android console to see:

E/Diagnostic: Exception occurred onRequestPermissionsResult: No context found for request id=1000
    java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CallbackContext.error(java.lang.String)' on a null object reference

and i found nothing on stack overflow or anywhere on internet, so, I'm here to ask for some help

*OnSucceedFunction and OnFailureFunction are just to make you understand what am I doing, I know if I write it it won't work



from Cordova Diagnostic Exception on Diagnostic.getExternalSdCardDetails()

No comments:

Post a Comment