Skip to content

Commit 661f4af

Browse files
Fixing bug
1 parent a7563c1 commit 661f4af

File tree

2 files changed

+34
-14
lines changed

2 files changed

+34
-14
lines changed

ios/Podfile

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require_relative '../node_modules/react-native/scripts/react_native_pods'
1+
22
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
33

44
platform :ios, '11.0'
@@ -38,25 +38,45 @@ target 'DynamsoftRnSample' do
3838
# pod 'henry-capture-vision-react-native', :podspec => '../node_modules/react-native/henry-capture-vision-react-native/henry-capture-vision-react-native.podspec'
3939
use_native_modules!
4040

41-
use_react_native!(
42-
:path => config[:reactNativePath],
43-
# to enable hermes on iOS, change `false` to `true` and then install pods
44-
:hermes_enabled => false
45-
)
41+
# use_react_native!(
42+
# :path => config[:reactNativePath],
43+
# # to enable hermes on iOS, change `false` to `true` and then install pods
44+
# :hermes_enabled => false
45+
# )
4646

47-
target 'DynamsoftRnSampleTests' do
48-
inherit! :complete
49-
# Pods for testing
50-
end
47+
# target 'DynamsoftRnSampleTests' do
48+
# inherit! :complete
49+
# # Pods for testing
50+
# end
5151

5252
# Enables Flipper.
5353
#
5454
# Note that if you have use_frameworks! enabled, Flipper will not work and
5555
# you should disable the next line.
56-
use_flipper!()
56+
# use_flipper!()
5757

58+
# post_install do |installer|
59+
# react_native_post_install(installer)
60+
# __apply_Xcode_12_5_M1_post_install_workaround(installer)
61+
# end
5862
post_install do |installer|
59-
react_native_post_install(installer)
60-
__apply_Xcode_12_5_M1_post_install_workaround(installer)
63+
## Fix for XCode 12.5
64+
find_and_replace("../node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm",
65+
"_initializeModules:(NSArray<id<RCTBridgeModule>> *)modules", "_initializeModules:(NSArray<Class> *)modules")
66+
find_and_replace("../node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm",
67+
"RCTBridgeModuleNameForClass(module))", "RCTBridgeModuleNameForClass(Class(module)))")
68+
end
69+
70+
def find_and_replace(dir, findstr, replacestr)
71+
Dir[dir].each do |name|
72+
text = File.read(name)
73+
replace = text.gsub(findstr,replacestr)
74+
if text != replace
75+
puts "Fix: " + name
76+
File.open(name, "w") { |file| file.puts replace }
77+
STDOUT.flush
78+
end
79+
end
80+
Dir[dir + '*/'].each(&method(:find_and_replace))
6181
end
6282
end

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"dependencies": {
1313
"react": "17.0.2",
1414
"react-native": "0.61.5",
15-
"henry-capture-vision-react-native": "1.0.0"
15+
"henry-capture-vision-react-native": "1.0.1"
1616
},
1717
"devDependencies": {
1818
"@babel/core": "^7.17.8",

0 commit comments

Comments
 (0)