Skip to content

Commit dcd56d8

Browse files
Fix sample app to run on Xcode 12.5
1 parent 5fca1bc commit dcd56d8

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

InstabugSample/ios/Podfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ target 'InstabugSample' do
2828
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
2929
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
3030

31+
post_install do |installer|
32+
## Fix for XCode 12.5 beta
33+
find_and_replace("../node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm",
34+
"_initializeModules:(NSArray<id<RCTBridgeModule>> *)modules", "_initializeModules:(NSArray<Class> *)modules")
35+
end
36+
3137
target 'InstabugSampleTests' do
3238
inherit! :search_paths
3339
# Pods for testing
@@ -36,3 +42,17 @@ target 'InstabugSample' do
3642

3743
use_native_modules!
3844
end
45+
46+
def find_and_replace(dir, findstr, replacestr)
47+
Dir[dir].each do |name|
48+
text = File.read(name)
49+
replace = text.gsub(findstr,replacestr)
50+
if text != replace
51+
puts "Fix: " + name
52+
File.open(name, "w") { |file| file.puts replace }
53+
STDOUT.flush
54+
end
55+
end
56+
Dir[dir + '*/'].each(&method(:find_and_replace))
57+
end
58+

0 commit comments

Comments
 (0)