Fix FullStory exception on iOS 17


I upgraded a React Native mobile app to iOS 17 and encountered an app crash when uploading images:

Terminating app due to uncaught exception 'NSInternalInconsistencyException'
UIGraphicsBeginImageContext() failed to allocate CGBitampContext: size={0, 0}, scale=3.000000, bitmapInfo=0x2002. Use UIGraphicsImageRenderer to avoid this assert.

UIGraphicsBeginImageContext() is a deprecated function in iOS 17 and when the width or height is 0, it throws an exception.

I did a recursive search for UIGraphicsBeginImageContext in my working directory:

grep -r UIGraphicsBeginImageContext

And found it’s used by FullStory:

Binary file ./ios/Pods/FullStory/FullStory.xcframework/ios-arm64_x86_64-simulator/FullStory.framework/FullStory matches
Binary file ./ios/Pods/FullStory/FullStory.xcframework/ios-arm64/FullStory.framework/FullStory matches


I reached out to FullStory support and they helped guide me to upgrade the iOS SDK to the latest version following their release notes.

I updated ios/Podfile:

-  pod 'FullStory', :http => ''
+  pod 'FullStory', :http => ''

Then ran pod install so ios/Podfile.lock is updated:

bundle exec pod install --project-directory=ios # cd ios; pod install; cd -

I also updated android/build.gradle to be consistent:

-        classpath 'com.fullstory:gradle-plugin-local:1.42.0'
+        classpath 'com.fullstory:gradle-plugin-local:1.48.0'

After restarting the React Native app, the error no longer showed up.

Please support this site and join our Discord!