[x] I confirm this is a suspected bug or issue that will affect other users
[x] I have reproduced the issue using the example project or provided the necessary information to reproduce the issue.
[x] I have read the documentation thoroughly and it does not help solve my issue.
[x] I have checked that no similar issues (open or closed) already exist.
Current behavior:
getExternalSdCardDetails before going on with internal logic first checks READ_EXTERNAL_STORAGE permission and if not set calls requestRuntimePermission for it ; but with following error:
Diagnostic[native]: Exception occurred onRequestPermissionsResult: No context found for request id=1000
Expected behavior:
Android code for listing SD cards should run without error whether or not the READ storage permission was set before or not.
Steps to reproduce:
Default setup of cordova-diagnostic-plugin-example and then from js or chrome://inspect call cordova.plugins.diagnostic.getExternalSdCardDetails(console.info, console.error).
Screenshots
Environment information
Cordova CLI version
cordova -v
cordova 10.0
Cordova platform version
cordova platform ls
cordova-android 9.0
Plugins & versions installed in project (including this plugin)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Bug report
CHECKLIST
[x] I have read the issue reporting guidelines
[x] I confirm this is a suspected bug or issue that will affect other users
[x] I have reproduced the issue using the example project or provided the necessary information to reproduce the issue.
[x] I have read the documentation thoroughly and it does not help solve my issue.
[x] I have checked that no similar issues (open or closed) already exist.
Current behavior:
getExternalSdCardDetails before going on with internal logic first checks READ_EXTERNAL_STORAGE permission and if not set calls requestRuntimePermission for it ; but with following error:
Expected behavior: Android code for listing SD cards should run without error whether or not the READ storage permission was set before or not.
Steps to reproduce:
Default setup of cordova-diagnostic-plugin-example and then from js or chrome://inspect call
cordova.plugins.diagnostic.getExternalSdCardDetails(console.info, console.error)
.Screenshots
Environment information
cordova -v
cordova 10.0cordova platform ls
cordova-android 9.0cordova plugin ls
cordova-plugin-androidx-adapter 1.1.3 cordova-plugin-androidx 1.0.2 cordova-plugin-device 2.0.3 cordova-plugin-file 6.0.2 cordova-plugin-geolocation 4.1.0 cordova-plugin-whitelist 1.3.4 cordova.plugins.diagnostic 6.0.2Runtime issue
Android build issue:
node -v
14 LTSls platforms/android/.gradle
6.7.1android:targetSdkVersion
inAndroidManifest.xml
29sdkmanager --list | sed -e '/Available Packages/q'
iOS build issue:
Related code:
Console output
console output
``` Diagnostic[native]: Exception occurred onRequestPermissionsResult: No context found for request id=1000 ```**Other information:**