Closed erdemildiz closed 4 years ago
:warning: | Missing Environment Information |
---|---|
:information_source: | Your issue may be missing information about your development environment. You can obtain the missing information by running react-native info in a console. |
Make sure you run pod repo update
in the ios dir
Unfortunately @crobinson42, pod repo update
didn't work. I am getting same error from this lines;
Do you see this problem when creating a new project? If this issue doesn't occur in a new project, I recommend you create an issue on the upgrade-support repo instead. Sharing your issues when upgrading on that repo will improve the likelihood that you will find others with the same problem and find fixes. It also helps others find you! 😄
@TheSavior I didn't try on new project. I will open this issue in upgrade-support
Did we able to solve this issue? I am also facing same issue on xcode 12.5 beta.
Same here. Xcode 12.5 beta specific problem. Here is change log, just in case.
This was fixed in the new rn version but if you don't want to upgrade
Add this post install script to your Podfile:
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
End of the Podfile add this function:
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
After adding this script, just run pod install command.
Happy Coding ❤️
@edrdesigner Build failed No matching function for call to 'RCTBridgeModuleNameForClass'
Heeeelp how to fix this problem?
Having same problem here, but im at .61, the problem is with Xcode 12.5, the last version 12.4 didnt have this problem.
This was fixed in the new rn version but if you don't want to upgrade
Add this post install script to your Podfile:
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
End of the Podfile add this function:
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
After adding this script, just run pod install command.
Happy Coding ❤️
I resolved the issue by this method and it's working pretty well in my side
@edrdesigner Build failed No matching function for call to 'RCTBridgeModuleNameForClass'
Heeeelp how to fix this problem?
You can try this. Using post install script of @edrdesigner above
post_install do |installer|
## Fix for XCode 12.5
find_and_replace("../node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm",
"_initializeModules:(NSArray<id<RCTBridgeModule>> *)modules", "_initializeModules:(NSArray<Class> *)modules")
find_and_replace("../node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm",
"RCTBridgeModuleNameForClass(module))", "RCTBridgeModuleNameForClass(Class(module)))")
end
Hope this helps
@edrdesigner Build failed No matching function for call to 'RCTBridgeModuleNameForClass' Heeeelp how to fix this problem?
You can try this
post_install do |installer| ## Fix for XCode 12.5 find_and_replace("node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm", "RCTBridgeModuleNameForClass(module))", "RCTBridgeModuleNameForClass(Class(module)))") end
Hope this helps
Its not work for me any ideas
This was fixed in the new rn version but if you don't want to upgrade
Add this post install script to your Podfile:
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
End of the Podfile add this function:
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
After adding this script, just run pod install command.
Happy Coding ❤️
Thanks it work for me in Xcode 12.5.
I had two issues, these replaces did the job:
post_install do |installer|
## Fix for XCode 12.5
find_and_replace("../node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm",
"_initializeModules:(NSArray<id<RCTBridgeModule>> *)modules", "_initializeModules:(NSArray<Class> *)modules")
find_and_replace("../node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm",
"RCTBridgeModuleNameForClass(module))", "RCTBridgeModuleNameForClass(Class(module)))")
end
[!] An error occurred while processing the post-install hook of the Podfile.
[!] Specifying multiple `post_install` hooks is unsupported.
please help me
[!] An error occurred while processing the post-install hook of the Podfile. [!] Specifying multiple `post_install` hooks is unsupported.
please help me
You have to define the replace function as well (at the bottom of the Pods file):
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
[!] An error occurred while processing the post-install hook of the Podfile. [!] Specifying multiple `post_install` hooks is unsupported.
please help me
You have to define the replace function as well (at the bottom of the Pods file):
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
I have defined this function at the bottom of podfile But there are still some errors after running pod install
@mygithub877
[!] Specifying multiple `post_install` hooks is unsupported.
Call find_and_replace
function on current post_install script, please don't define new post_install script
@mygithub877
[!] Specifying multiple `post_install` hooks is unsupported.
Call
find_and_replace
function on current post_install script, please don't define new post_install script
[!] An error occurred while processing the post-install hook of the Podfile.
Permission denied @ rb_sysopen - Pods/FBRetainCycleDetector/FBRetainCycleDetector/Layout/Classes/FBClassStrongLayout.mm
What to do now?
Getting the same error
node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm:307:13: No matching function for call to 'RCTBridgeModuleNameForClass'
Getting the same error
node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm:307:13: No matching function for call to 'RCTBridgeModuleNameForClass'
So I was able to fix it by this code
find_and_replace("../node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm", "_initializeModules:(NSArray<id<RCTBridgeModule>> *)modules", "_initializeModules:(NSArray<Class> *)modules")
find_and_replace("../node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm", "RCTBridgeModuleNameForClass(module))", "RCTBridgeModuleNameForClass(Class(module)))")
find_and_replace("../node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm", "RCTBridgeModuleNameForClass(strongModule))", "RCTBridgeModuleNameForClass(Class(strongModule)))")
inserted iside post_install do |installer|
If you also getting 'atomic_notify_one<unsigned long>' is unavailable
Do this as temporary fix.
Getting the same error
node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm:307:13: No matching function for call to 'RCTBridgeModuleNameForClass'
i was to fix it is update xcode after 2.5
Getting the same error
node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm:307:13: No matching function for call to 'RCTBridgeModuleNameForClass'
So I was able to fix it by this code
find_and_replace("../node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm", "_initializeModules:(NSArray<id<RCTBridgeModule>> *)modules", "_initializeModules:(NSArray<Class> *)modules") find_and_replace("../node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm", "RCTBridgeModuleNameForClass(module))", "RCTBridgeModuleNameForClass(Class(module)))") find_and_replace("../node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm", "RCTBridgeModuleNameForClass(strongModule))", "RCTBridgeModuleNameForClass(Class(strongModule)))")
inserted iside
post_install do |installer|
If you also getting
'atomic_notify_one<unsigned long>' is unavailable
Do this as temporary fix.
this works. Thanks.
Hi. For me worked merge between the solutions from @ducnnguyen @giangdinh ` post_install do |installer|
find_and_replace("../node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm",
"_initializeModules:(NSArray<id<RCTBridgeModule>> *)modules", "_initializeModules:(NSArray<Class> *)modules")
find_and_replace("../node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm",
"RCTBridgeModuleNameForClass(module))", "RCTBridgeModuleNameForClass(Class(module)))")
end 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
Use patch-packages
!
I think writing above codes on the Podfile
is not sure.
Because above solution are the code that simply replace part of codes on the node_modules/react-native
.
This is not a responsibility of Podfile
.
Here's my solution.
yarn add -D patch-package
node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm
and replace _initializeModules:(NSArray<id<RCTBridgeModule>> *)modules
to _initializeModules:(NSArray<Class> *)modules
node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm
and replace RCTBridgeModuleNameForClass(module))
to RCTBridgeModuleNameForClass(Class(module)))
yarn patch-package react-native
this solution ^^ by @devethan is the right approach! 💯 Fixed the issue for me!
Worked for me perfectly. Thx @devethan
I fix with RTCTTurboModuleManager.mm file
307: RCTBridgeModuleNameForClass(strongModule));
to
307: RCTBridgeModuleNameForClass([strongModule class]));
@devethan Thank you good sir. It works.
This was fixed in the new rn version but if you don't want to upgrade
Add this post install script to your Podfile:
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
End of the Podfile add this function:
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
After adding this script, just run pod install command.
Happy Coding ❤️
This works great for me 💯
I had two issues, these replaces did the job:
post_install do |installer| ## Fix for XCode 12.5 find_and_replace("../node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm", "_initializeModules:(NSArray<id<RCTBridgeModule>> *)modules", "_initializeModules:(NSArray<Class> *)modules") find_and_replace("../node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm", "RCTBridgeModuleNameForClass(module))", "RCTBridgeModuleNameForClass(Class(module)))") end
How did you figure that out?
Congrats to Xcode that makes me lost many hours trying to solve a fucking issue that didn't exist before
Congrats to Xcode that makes me lost many hours trying to solve a fucking issue that didn't exist before
It nice to find quickly a solution for the newest problems. Thanks.
@devethan is the man!!
@edrdesigner Build failed No matching function for call to 'RCTBridgeModuleNameForClass' Heeeelp how to fix this problem?
You can try this
post_install do |installer| ## Fix for XCode 12.5 find_and_replace("node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm", "RCTBridgeModuleNameForClass(module))", "RCTBridgeModuleNameForClass(Class(module)))") end
Hope this helps
Its not work for me any ideas
Make Sure the two scripts are at the bottom of your pod-file and then use this as the post_installer script
post_install do |installer| find_and_replace("../node_modules/react native/React/CxxBridge/RCTCxxBridge.mm", "_initializeModules:(NSArray<id<RCTBridgeModule>> *)modules", "_initializeModules:(NSArray<Class> *)modules") find_and_replace("../node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm", "RCTBridgeModuleNameForClass(strongModule))", "RCTBridgeModuleNameForClass(Class(strongModule)))") end
instead of Module for RCTBridgeModuleNameForClass its been updated to strongModule which worked for me
@edrdesigner Build failed No matching function for call to 'RCTBridgeModuleNameForClass' Heeeelp how to fix this problem?
You can try this
post_install do |installer| ## Fix for XCode 12.5 find_and_replace("node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm", "RCTBridgeModuleNameForClass(module))", "RCTBridgeModuleNameForClass(Class(module)))") end
Hope this helps
Its not work for me any ideas
Should say ../node_modules/react-native/
@edrdesigner
I tried your solution but seems like there is something missing. I am getting another error while building on Xcode 12.5
building for iOS Simulator, but linking in object file built for iOS, for architecture arm64
In my case I solved it by changing from 9.0
to 10.0
the line: platform: iso
, from the Podfile file and then executing pod install --repo- -update
.
Hey all. We implemented the solution in @edrdesigner original post and this fixed our compiling issues with this same error. Our app now compiles and runs locally on a simulator and on a physical device but our testflight builds crash immediately on load with __28-[RCTCxxBridge handleError:]_block_invoke + 704 (RCTCxxBridge.mm:965)
. Just seeing if anyone has a similar issue after using this fix.
Having same problem here, but im at .61, the problem is with Xcode 12.5, the last version 12.4 didnt have this problem.
did you solve your issue?
Use
patch-packages
! I think writing above codes on thePodfile
is not sure. Because above solution are the code that simply replace part of codes on thenode_modules/react-native
. This is not a responsibility ofPodfile
.Here's my solution.
yarn add -D patch-package
- Go to
node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm
and replace_initializeModules:(NSArray<id<RCTBridgeModule>> *)modules
to_initializeModules:(NSArray<Class> *)modules
- Go to
node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm
and replaceRCTBridgeModuleNameForClass(module))
toRCTBridgeModuleNameForClass(Class(module)))
yarn patch-package react-native
- Then a patch file will be created. (Checkout the patch-package)
Thank you @devethan . Your solution worked for me.
From the comment of @devethan I propose this bash script to be launched from root of the project:
DIR="node_modules"
if [ -d "$DIR" ]; then
echo "fixing react files in ${DIR}..."
else
echo "missing node_modules folder, are you running this script from the correct path?"
exit 1
fi
TARGET_FILE="./node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm"
FROM="_initializeModules:(NSArray<id<RCTBridgeModule>>\ \*)modules"
TO="_initializeModules:(NSArray<Class>\ \*)modules"
sed -i -e "s/$FROM/$TO/g" $TARGET_FILE
TARGET_FILE="./node_modules/react-native/ReactCommon/turbomodule/core/platform/iOS/RCTTurboModuleManager.mm"
FROM="RCTBridgeModuleNameForClass(module))"
TO="RCTBridgeModuleNameForClass(Class(module)))"
sed -i -e "s/$FROM/$TO/g" $TARGET_FILE
echo "now RCTCxxBridge.mm and RCTTurboModuleManager.mm should be fixed"
Using patch-package
should be the preferred way, but for someone like me that for some reasons couldn't use patch-package
, this script could be a valid alternative. I put it in the post-install
into package.json.
Hi everyone! I'm running RN v0.61.5 and this is what worked for me:
post_install do |installer|
## Fix for XCode 12.5
find_and_replace("../node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm",
"_initializeModules:(NSArray<id<RCTBridgeModule>> *)modules", "_initializeModules:(NSArray<Class> *)modules")
find_and_replace("../node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm",
"RCTBridgeModuleNameForClass(module))", "RCTBridgeModuleNameForClass([module class]))")
end
Notice the RCTBridgeModuleNameForClass([module class]))
instead of the RCTBridgeModuleNameForClass(Class(module)))
of other solutions above.
And at the very end of the Podfile:
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
Thanks to all the ones who contributed to this thread!
Note: The patch-package
solution didn't work for me, I don't really know why. The patch section for the file RCTTurboModuleManager.mm
was generated but always returned an error at the moment of patching.
I'm running RN v0.61.x This solution is working well. Thanks for your report.
post_install do |installer|
find_and_replace("../node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm",
"_initializeModules:(NSArray<id<RCTBridgeModule>> *)modules", "_initializeModules:(NSArray<Class> *)modules")
find_and_replace("../node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm",
"RCTBridgeModuleNameForClass(module))", "RCTBridgeModuleNameForClass([module class]))")
end Notice the RCTBridgeModuleNameForClass([module class])) instead of the RCTBridgeModuleNameForClass(Class(module))) of other solutions above.
And at the very end of the Podfile:
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
@devethan thank you. you save my day
thanks @edgarbonillag I confirm your fix works for RN 0.61.5
Congrats to Xcode that makes me lost many hours trying to solve a fucking issue that didn't exist before
dont think like that. As a developer you and everyone is trying to do something like they do. which we are giving some releases or updates to relevant clients, it can be a developer or customer or whoever just imaging someone blaming you for a buggy app or website. you know how much hard work behind that small update. look how many answers are there. rather than blaming just do some work around and be patient.
@russelRajitha Well said! We're all in this together. I was very frustrated 20 minutes ago when I encountered these issues after upgrading macOS and XCode. But I have had issues like this before and I know that it's something to do with react-native & XCode compatibility and because of that that many people would have the same problem. Also, blaming XCode is missing the point... XCode doesn't exist solely to compile react-native apps and breaking changes to complex systems in constant development should be expected. React-native developers fixed the issue in the latest versions and so it seems entirely on the user to either upgrade, or to just humbly take the help of thousands of people that is readily available.
I upgrade 0.61.5 → 0.62.0 version but getting below error
cannot initialize a parameter of type 'NSArray<id<RCTBridgeModule>> *' with an lvalue of type 'NSArray<Class> *__strong' NSArray<RCTModuleData *> *newModules = [self _initializeModules:modules withDispatchGroup:NULL lazilyDiscovered:YES];
React Native Info:
This line:
https://github.com/facebook/react-native/blob/6ce3f0a4f7495adb82e655d037dc4e5af462f955/React/CxxBridge/RCTCxxBridge.mm#L778