I was running an expo project and I kept getting this same error. The problem was only coming up when I used ios Similator latest ( OS 18.4) and not on Android. So I changed to OS 18.3 and it worked. Seem the latest version had issues