From f4ef00d4ea87e3f82034bcfe8ca8fca7cdbcd257 Mon Sep 17 00:00:00 2001 From: MariaZ Date: Sat, 5 Feb 2022 20:11:35 +0100 Subject: [PATCH] Fix adding images to final build --- ios/Podfile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ios/Podfile b/ios/Podfile index 0786e40..5d7f8da 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -41,4 +41,22 @@ target 'drip' do use_native_modules! use_frameworks! + + post_install do |installer| + find_and_replace("../node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m", + "_currentFrame.CGImage;","_currentFrame.CGImage ;} else { [super displayLayer:layer];") + end + + def find_and_replace(dir, findstr, replacestr) + Dir[dir].each do |name| + text = File.read(name) + replace = text.gsub(findstr,replacestr) + if text != replace + puts "Fix: " + name + File.open(name, "w") { |file| file.puts replace } + STDOUT.flush + end + end + Dir[dir + '*/'].each(&method(:find_and_replace)) + end end