Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error listing external SD cards without prior READ storage permission #427

Closed
5 tasks done
ath0mas opened this issue Dec 21, 2020 · 1 comment
Closed
5 tasks done
Labels

Comments

@ath0mas
Copy link

ath0mas commented Dec 21, 2020

Bug report

CHECKLIST

  • I have reproduced the issue using the example project or provided the necessary information to reproduce the issue.
  • 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)
    • cordova 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.2
  • Dev machine OS and version
    • .

Runtime issue

  • Device details
    • Android Emulator
  • OS details
    • Android 11.0

Android build issue:

  • Node JS version
    • node -v
      14 LTS
  • Gradle version
    • ls platforms/android/.gradle
      6.7.1
  • Target Android SDK version
    • android:targetSdkVersion in AndroidManifest.xml
      29
  • Android SDK details
    • sdkmanager --list | sed -e '/Available Packages/q'

iOS build issue:

  • .

Related code:

cordova.plugins.diagnostic.getExternalSdCardDetails(console.info, console.error)

Console output

console output

Diagnostic[native]: Exception occurred onRequestPermissionsResult: No context found for request id=1000



Other information:

@stale
Copy link

stale bot commented May 12, 2021

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.

@stale stale bot added the wontfix label May 12, 2021
@stale stale bot closed this as completed May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant