Tauri config:
{
"app": {
"security": {
"assetProtocol": {
"enable": true,
"scope": ["$RESOURCE", "$RESOURCE/**"]
}
}
},
"bundle": {
"resources": ["Resources/*"]
}
}
The following code gives me an error on android:
const files = await readDir('Resources', { baseDir: BaseDirectory.Resource });
It gives failed to read directory at path: asset://localhost/Resources with error: No such file or directory (os error 2) error
When I try with this:
const p = await resolveResource('Resources');
const files = await readDir(p);
then android gives me an forbidden path: /Resources exception...
Oh and btw this does work on android.
const p = await resolveResource('Resources/Release-notes.txt');
const content = await readTextFile(p);
But when using the other method with baseDir:
const content = await readTextFile('Resources/Release-notes.txt', { baseDir: BaseDirectory.Resource });
then it doesnt work -> failed to open file at path: asset://localhost/Resources/Release-notes.txt with error: No such file or directory (os error 2):