Anyone please help. I have a base64 string in capacitor storage and its working on web but when i run the app into android emulator then its not working at all. What the issue and how can i fix this. Help please!
can u share ur code please or provide a demo ?
I have the same problem with capacitor3 and this is my code:
import { Storage } from "@capacitor/storage";
....
setup() {
const state = reactive({
path: "/tabs/index",
isOpend: true,
});
const set = async (key, value) => {
await Storage.set({
key: key,
value: value,
});
};
const get = async (key) => {
const { value } = await Storage.get({ key: key });
return value;
};
get("isOpendBefore").then((value) => {
if (value) {
alert("exist: " + value);
router.replace(state.path);
} else {
alert("not exist: " + value);
set("isOpendBefore", true);
state.isOpend = false;
}
});
return { ...toRefs(state) };
},
the alert is always null
and this is the log on android studio
D/Capacitor: Starting BridgeActivity
D/Capacitor: Registering plugin: WebView
D/Capacitor: Registering plugin: App
D/Capacitor: Registering plugin: Storage
E/Capacitor: Unable to read file at path public/plugins
D/Capacitor: Loading app at http://localhost
D/Capacitor: App started
....
V/Capacitor/Plugin: To native (Capacitor plugin): callbackId: 72891772, pluginId: Storage, methodName: set
V/Capacitor: callback: 72891772, pluginId: Storage, methodName: set, methodData: {"key":"isOpendBefore","value":true}