diachedelic / capacitor-blob-writer

Capacitor plugin to write binary data to the filesystem
MIT License
132 stars 17 forks source link

Android Permission error #72

Closed jaagitteam closed 11 months ago

jaagitteam commented 11 months ago

I got following error in Android Studio with this plugin, working fine on web in dev:

To native (Capacitor plugin): callbackId: 107792336, pluginId: BlobWriter, methodName: get_config 2023-12-13 15:35:46.576 22949-22949 Capacitor com.javedahmadghamidi.ghamidi V callback: 107792336, pluginId: BlobWriter, methodName: get_config, methodData: {} 2023-12-13 15:35:46.577 22949-22949 Capacitor/Plugin com.javedahmadghamidi.ghamidi V To native (Capacitor plugin): callbackId: 107792337, pluginId: Filesystem, methodName: getUri 2023-12-13 15:35:46.578 22949-22949 Capacitor com.javedahmadghamidi.ghamidi V callback: 107792337, pluginId: Filesystem, methodName: getUri, methodData: {"path":"gazdar\/001-001.aac","directory":"DOCUMENTS"} 2023-12-13 15:35:46.605 22949-23113 TrafficStats com.javedahmadghamidi.ghamidi D tagSocket(231) with statsTag=0xffffffff, statsUid=-1 2023-12-13 15:35:46.627 22949-23285 Capacitor/BlobWriter com.javedahmadghamidi.ghamidi D OPTIONS /storage/emulated/0/Documents/gazdar/001-001.aac 2023-12-13 15:35:46.646 22949-23285 Capacitor/BlobWriter com.javedahmadghamidi.ghamidi D PUT /storage/emulated/0/Documents/gazdar/001-001.aac 2023-12-13 15:35:46.685 22949-23285 Capacitor/BlobWriter com.javedahmadghamidi.ghamidi E failed to write file java.io.FileNotFoundException: /storage/emulated/0/Documents/gazdar/001-001.aac: open failed: EACCES (Permission denied) at libcore.io.IoBridge.open(IoBridge.java:574)

Any idea what is wrong. Manifest include following: <application android:usesCleartextTraffic="true"

user permissions "android.permission.READ_EXTERNAL_STORAGE" "android.permission.WRITE_EXTERNAL_STORAGE"

jaagitteam commented 11 months ago

ok it works now with Directory.Data, i was trying with Directory.Documents. do you know the reason why it is so?

diachedelic commented 11 months ago

Sorry, I don't.