-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.61.5 → 0.62.0 RCTBridgeModule Error #28405
Comments
|
Make sure you run |
Unfortunately @crobinson42, react-native/React/CxxBridge/RCTCxxBridge.mm Line 329 in 6ce3f0a
react-native/React/CxxBridge/RCTCxxBridge.mm Line 773 in 6ce3f0a
react-native/React/CxxBridge/RCTCxxBridge.mm Line 832 in 6ce3f0a
|
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 |
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 Heeeelp how to fix this problem? |
I resolved the issue by this method and it's working pretty well in my side |
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 |
Its not work for me |
Thanks it work for me in Xcode 12.5. |
I had two issues, these replaces did the job:
|
please help me |
You have to define the replace function as well (at the bottom of the Pods file):
|
I have defined this function at the bottom of podfile |
[!] Specifying multiple `post_install` hooks is unsupported. Call |
In my case I solved it by changing from |
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 |
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:
Using |
Hi everyone! I'm running RN v0.61.5 and this is what worked for me:
Notice the And at the very end of the Podfile:
Thanks to all the ones who contributed to this thread! Note: The |
I'm running RN v0.61.x This solution is working well. Thanks for your report. post_install do |installer| And at the very end of the Podfile: def find_and_replace(dir, findstr, replacestr) |
@devethan thank you. you save my day |
thanks @edgarbonillag I confirm your fix works for RN 0.61.5 |
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. |
If you are using a much older version of react-native (I was on So I adjusted the script @strawberry-code mentioned above and now run this on a
There's more patches in this script in reality (to patch other things that have broken over the years) but this part addresses this specific issue. |
You da man !! |
where to add the first code? |
change RCTCxxBridge.mm in line number 624 NSArray<id> *)modules to *NSArray )modules |
hi I got another problem after add below codes in podfile, the problem is "main.jsbundle does not exist. This must be a bug with", I have tried all most every way posted online, it didn't solve the problem. my react native version is 61.5. post_install do |installer| def find_and_replace(dir, findstr, replacestr) |
In some cases, you may also need this third one :) post_install do |installer| |
Was heplful. Thank you. |
post_install do |installer|
这样写没有用 |
it's worked for me, thanks |
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:
react-native/React/CxxBridge/RCTCxxBridge.mm
Line 778 in 6ce3f0a
The text was updated successfully, but these errors were encountered: