android issue for ionic cap build android
Diptadip opened this issue · comments
I implemented this VAD in my ionic react capacitor app.
const vad = useMicVAD({
stream,
workletURL: "/vad.worklet.bundle.min.js",
modelURL: "/silero_vad.onnx",
startOnLoad: true,
onSpeechEnd: (audio) => {
console.log("audio", audio);
const wavBuffer = utils.encodeWAV(audio);
const base64 = utils.arrayBufferToBase64(wavBuffer);
const url = data:audio/wav;base64,${base64}
;
setAudioList((old) => [url, ...old]);
},
});
Used this hook. The APP works fine in web but when I do ionic cap build android and run the app on an android device or emulator, I get a blank scrren and this error.
Uncaught TypeError: Cannot read properties of undefined (reading 'useLayoutEffect') at @ricky0123-B6Z9CSti.js:5:5483 at @ricky0123-B6Z9CSti.js:5:5520
Even though I am not using useLayoutEffect in any of my code. Could not find any way out this. What could possibly cause the error ?How can it be solved?