Open 1192724521 opened 1 year ago
Now i don't know if the asset protocol itself even works on android but to fix convertFileSrc
you could do something like this, using the os
plugin from here https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/os
let path = convertFileSrc(yourPathHere);
if (await os.type() === 'android' {
path = path.replace("asset://localhost/", "https://asset.localhost/");
}
Is it better to use this method? tauri.cjs
function y(n, e = "asset") {
let r = encodeURIComponent(n);
//return navigator.userAgent.includes("Windows") ? `https : //${e}.localhost/${r}` : `${e}://localhost/${r}`
return navigator.userAgent.includes("Windows") || navigator.userAgent.includes("Android")? `https://${e}.localhost/${r}` : `${e}://localhost/${r}`
}
last time i checked the useragent didn't include Android i think. But if it does work then yeah, ig it would be better.
Yeah it's being updated on the IPC refactor PR.
I got a new problem when I switched to https://asset.localhost/ emmm
GET https://asset.localhost/%2Fdata%2Fuser%2F0%2Fcom.tauri.tauriv2%2Fcache%2Fmap_load.js
net::ERR_CONNECTION_REFUSED
How do I use convertFileSrc
、 asset
、readBinaryFile
in android
Describe the bug
mobile android
GET asset://localhost/%2Fdata%2Fuser%2F0%2Fcom.tauri.tauriv2%2Fcache%2Ffilename.js net::ERR_UNKNOWN_URL_SCHEME Excuse me How to open local asset resource/**
Reproduction
No response
Expected behavior
No response
Platform and versions
Stack trace
No response
Additional context
No response