[TypeError: this.nativeUtils().setKeepDeviceAwake ...
# support
r
i need an urgent fix for this error using rn sdk
v
Hi there! I understand you're facing an urgent issue with the
TypeError: this.nativeUtils().setKeepDeviceAwake is not a function (it is undefined)
error in your React Native app. While I can't provide a specific fix without seeing your exact code implementation, I can definitely help with troubleshooting steps and potential solutions based on information I've found. Here are some potential causes and solutions: ## SDK Version Compatibility One of the most common causes appears to be SDK version incompatibility. According to [information from Discord](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1239945056937443510), Vapi RN requires Expo SDK 50, and using a different version (like 51) could be causing this bug. Try downgrading to Expo SDK 50 if you're using a newer version. ## Dependency Issues Make sure all required dependencies are correctly installed with compatible versions. Check your
package.json
file and ensure you're using the latest version of the Vapi package and that all dependencies are up to date. ## Implementation Reference You can check the correct implementation in the [React Native SDK repository](https://github.com/VapiAI/react-native-sdk) and the [React Native Client Example](https://github.com/VapiAI/client-side-example-react-native) to ensure you're using the API correctly. ## Additional Troubleshooting Steps - Try using
useRef
instead of a regular variable for the Vapi instance - Check network connectivity (the function might rely on network access) - Review your VAPI configuration for any incorrect settings - Test on a real device instead of an emulator if possible - Look for additional logs that might provide more insight Is there any specific part of your implementation you'd like me to help with further? Sources: - [Discord Thread](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1239945056937443510) - [React Native SDK](https://github.com/VapiAI/react-native-sdk)
s
Hey Richard, can you please create a GitHub issue for this and share the steps to reproduce it? Also share the error stack trace and error logs will help us understand what could have been going wrong for you, and then eventually get it resolved
b
I'm having this issue too. Really hampering my progress. Seems to be a daily-js issue though, not supporting new arch in RN.
k
Hi, checking if this is resolved/solved for you?
b
@Shubham Bajaj I don't think this can be fully solved until daily-js supports the new architeure; a workaround is possible by disabling new architecture, but the idea is to actually utilise the new architecture, and disabling it is only a temporary solution; perhaps VAPI can look at forking daily and implementing support for the new architecture
k
Hey, a PR has been merged for upgrading the daily version into the HTML script tag repository, which shows VAPI web JavaScript code. Soon we will release a new version, and after that, you can use the code without any deprecated dependencies.