Richard
03/25/2025, 10:46 AMVapi Support Bot
03/25/2025, 10:47 AMTypeError: 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)Vapi Support Bot
03/25/2025, 10:47 AMShubham Bajaj
03/26/2025, 2:36 PMbouwerp
04/03/2025, 3:44 AMKyle Brunker
04/06/2025, 12:39 PMbouwerp
04/07/2025, 7:32 AMKyle Brunker
04/14/2025, 5:13 AM