this problem may also be related to the react-native version.
I am using react native version 0.68.1 and in this version UIGraphicsBeginImageContext() methods are used. new react native versions do not use these methods.
If your project is small, you can switch to the new react native version.
You can check this video as a solution: https://www.youtube.com/watch?v=psIBtbwMLQE