react-native: RCTUIImageViewAnimated incompatible with iOS 14
Images do not render on iOS 14 beta devices
Please see https://github.com/SDWebImage/SDWebImage/issues/3040 for a discussion.
Looks as if [super displayLayer]
needs to be called manually now.
#pragma mark - CALayerDelegate
- (void)displayLayer:(CALayer *)layer
{
if (_currentFrame) {
layer.contentsScale = self.animatedImageScale;
layer.contents = (__bridge id)_currentFrame.CGImage;
} else {
[super displayLayer:layer]; // this here!
}
}
Please provide all the information requested. Issues that do not follow this format are likely to stall.
Description
Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest React Native release to make sure your issue has not already been fixed: https://reactnative.dev/docs/upgrading.html
React Native version:
Run react-native info
in your terminal and copy the results here.
System: OS: macOS 10.15.5 CPU: (16) x64 Intel® Core™ i9-9980HK CPU @ 2.40GHz Memory: 3.83 GB / 32.00 GB Shell: 5.7.1 - /bin/zsh Binaries: Node: 14.5.0 - /usr/local/bin/node Yarn: Not Found npm: 6.14.5 - /usr/local/bin/npm Watchman: Not Found Managers: CocoaPods: 1.9.3 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2 Android SDK: API Levels: 27, 28, 29 Build Tools: 28.0.3, 29.0.2 System Images: android-24 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom Android NDK: Not Found IDEs: Android Studio: 4.0 AI-193.6911.18.40.6514223 Xcode: 11.5/11E608c - /usr/bin/xcodebuild Languages: Java: 1.8.0_232 - /usr/bin/javac Python: 2.7.16 - /usr/bin/python npmPackages: @react-native-community/cli: ^4.10.1 => 4.10.1 react: ^16.13.0 => 16.13.1 react-native: ^0.62.2 => 0.62.2 npmGlobalPackages: react-native: Not Found
Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.
Expected Results
Describe what you expected to happen.
Snack, code example, screenshot, or link to a repository:
Please provide a Snack (https://snack.expo.io/), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 22
- Comments: 16
Links to this issue
Commits related to this issue
- fix(flagship): add init script to patch rn images for ios 14 This adds a script to iOS init that patches RCTUIImageViewAnimated.m to display images in iOS 14. See issue here: https://github.com/face... — committed to bweissbart/flagship by bweissbart 4 years ago
- fix(flagship): add init script to patch rn images for ios 14 This adds a script to iOS init that patches RCTUIImageViewAnimated.m to display images in iOS 14. See issue here: https://github.com/face... — committed to bweissbart/flagship by bweissbart 4 years ago
- fix(flagship): add init script to patch rn images for ios 14 This adds a script to iOS init that patches RCTUIImageViewAnimated.m to display images in iOS 14. See issue here: https://github.com/face... — committed to bweissbart/flagship by bweissbart 4 years ago
- fix(flagship): add init script to patch rn images for ios 14 This adds a script to iOS init that patches RCTUIImageViewAnimated.m to display images in iOS 14. See issue here: https://github.com/face... — committed to crherman7/flagship by bweissbart 4 years ago
- fix(flagship): add init script to patch rn images for ios 14 This adds a script to iOS init that patches RCTUIImageViewAnimated.m to display images in iOS 14. See issue here: https://github.com/face... — committed to crherman7/flagship by bweissbart 4 years ago
proper fix (so that for example react-native-video also works) would be this (calling super displayLayer always):
React Native v0.61.4
Updated version with
patch-package
patch-package
into your project patch-package"postinstall": "patch-package"
patches
and the filereact-native+0.61.4.patch
inside of it on your root project directory:node_modules
and install the packages again.All the shells and script files I organize into
scripts
directory.I made the following steps to fix:
scripts/fix_images_ios_14.sh
;"postinstall": "sh ./scripts/fix_images_ios_14.sh"
;node_modules
and install packages again withyarn/npm
.Hi Raksha21, in which version was this error fixed? I still experience it with react-native 0.66.3
https://github.com/ds300/patch-package is a good solution for that