Fix sample app to run on Xcode 12.5
@@ -28,6 +28,12 @@ target 'InstabugSample' do
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
+ post_install do |installer|
+ ## Fix for XCode 12.5 beta
+ find_and_replace("../node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm",
+ "_initializeModules:(NSArray<id<RCTBridgeModule>> *)modules", "_initializeModules:(NSArray<Class> *)modules")
+ end
+
target 'InstabugSampleTests' do
inherit! :search_paths
# Pods for testing
@@ -36,3 +42,17 @@ target 'InstabugSample' do
use_native_modules!
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
+
