Skip to content
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

Closed
erdemildiz opened this issue Mar 26, 2020 · 60 comments
Closed

0.61.5 → 0.62.0 RCTBridgeModule Error #28405

erdemildiz opened this issue Mar 26, 2020 · 60 comments
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Environment Info Please run `react-native info` and edit your issue with that command's output. Resolution: Locked This issue was locked by the bot.

Comments

@erdemildiz
Copy link

erdemildiz commented Mar 26, 2020

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:

System:
    OS: macOS 10.15.3
    CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
    Memory: 63.01 MB / 8.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 10.15.3 - /usr/local/bin/node
    Yarn: 1.15.2 - ~/.yarn/bin/yarn
    npm: 6.4.1 - /usr/local/bin/npm
    Watchman: Not Found
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK:
      API Levels: 23, 25, 26, 27, 28, 29
      Build Tools: 27.0.3, 28.0.3, 29.0.0, 29.0.1, 29.0.2
      System Images: android-27 | Google Play Intel x86 Atom, android-28 | Intel x86 Atom, android-28 | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.6010548
    Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
  Languages:
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: 0.62.0 => 0.62.0 
  npmGlobalPackages:
    *react-native*: Not Found 

This line:

NSArray<RCTModuleData *> *moduleDataById = [self _registerModulesForClasses:modules

@react-native-bot react-native-bot added Needs: Author Feedback Needs: Environment Info Please run `react-native info` and edit your issue with that command's output. and removed Needs: Triage 🔍 labels Mar 26, 2020
@label-actions
Copy link

label-actions bot commented Mar 26, 2020

⚠️ Missing Environment Information
ℹ️ Your issue may be missing information about your development environment. You can obtain the missing information by running react-native info in a console.

@crobinson42
Copy link

Make sure you run pod repo update in the ios dir

@erdemildiz
Copy link
Author

erdemildiz commented Mar 27, 2020

Unfortunately @crobinson42, pod repo update didn't work. I am getting same error from this lines;

(void)[self _initializeModules:RCTGetModuleClasses() withDispatchGroup:prepareBridge lazilyDiscovered:NO];

- (NSArray<RCTModuleData *> *)_initializeModules:(NSArray<Class> *)modules

NSArray<RCTModuleData *> *newModules = [self _initializeModules:modules

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Mar 27, 2020
@elicwhite
Copy link
Member

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! 😄

@erdemildiz
Copy link
Author

erdemildiz commented Mar 27, 2020

@TheSavior I didn't try on new project. I will open this issue in upgrade-support

@pjhaok
Copy link

pjhaok commented Feb 14, 2021

Did we able to solve this issue? I am also facing same issue on xcode 12.5 beta.

@damikdk
Copy link

damikdk commented Feb 14, 2021

Same here. Xcode 12.5 beta specific problem. Here is change log, just in case.

@edrdesigner
Copy link

edrdesigner commented Feb 15, 2021

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 ❤️

@artyom-developer
Copy link

@edrdesigner Build failed
No matching function for call to 'RCTBridgeModuleNameForClass'

Heeeelp how to fix this problem?

@TreemboLuisDev
Copy link

Having same problem here, but im at .61, the problem is with Xcode 12.5, the last version 12.4 didnt have this problem.
image

@dhyana1984
Copy link

dhyana1984 commented Apr 27, 2021

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

@ducnnguyen
Copy link

ducnnguyen commented Apr 27, 2021

@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

@GalushkoVasiliy
Copy link

@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

@giangdinh
Copy link

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.

@ptfly
Copy link

ptfly commented Apr 27, 2021

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

@mygithub877
Copy link

[!] An error occurred while processing the post-install hook of the Podfile.

[!] Specifying multiple `post_install` hooks is unsupported.

please help me

@ptfly
Copy link

ptfly commented Apr 27, 2021

[!] 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

@mygithub877
Copy link

[!] 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

@ducnnguyen
Copy link

ducnnguyen commented Apr 27, 2021

@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

@glennperez
Copy link

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.

@eclecticjohny
Copy link

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.

@comalex
Copy link

comalex commented May 10, 2021

Having same problem here, but im at .61, the problem is with Xcode 12.5, the last version 12.4 didnt have this problem.
image

did you solve your issue?

@vishwadeepghimirezph
Copy link

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.

  1. yarn add -D patch-package
  2. Go to node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm and replace _initializeModules:(NSArray<id<RCTBridgeModule>> *)modules to _initializeModules:(NSArray<Class> *)modules
  3. Go to node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm and replace RCTBridgeModuleNameForClass(module)) to RCTBridgeModuleNameForClass(Class(module)))
  4. yarn patch-package react-native
  5. Then a patch file will be created. (Checkout the patch-package)

Thank you @devethan . Your solution worked for me.

@strawberry-code
Copy link

strawberry-code commented May 12, 2021

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.

@edgarbonillag
Copy link

edgarbonillag commented May 14, 2021

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.

@solutioner00
Copy link

I'm running RN v0.61.x This solution is working well. Thanks for your report.

post_install do |installer|
## Fix for XCode 12.5
find_and_replace("../node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm",
"_initializeModules:(NSArray<id> *)modules", "_initializeModules:(NSArray *)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

@hb-abhilash
Copy link

@devethan thank you. you save my day

@DylanVerstraete
Copy link

thanks @edgarbonillag I confirm your fix works for RN 0.61.5

@russelRajitha
Copy link

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.

plaredspear added a commit to plaredspear/react-native-naver-map that referenced this issue May 25, 2021
@allthetime
Copy link

@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.

@BenShelton
Copy link

If you are using a much older version of react-native (I was on 0.54.4 😬 ) then the name of the method may be _initModules instead of _initializeModules. And RCTTurboModuleManager doesn't even exist. Plus I was on a version before the Podfile was a thing 😅

So I adjusted the script @strawberry-code mentioned above and now run this on a postinstall script in package.json:

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="_initModules:(NSArray<id<RCTBridgeModule>>\ \*)modules"
TO="_initModules:(NSArray<Class>\ \*)modules"
sed -i -e "s/$FROM/$TO/g" $TARGET_FILE

echo "now RCTCxxBridge.mm should be fixed"

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.

@prateekchitransh1907
Copy link

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 ❤️

You da man !!

@Hudamp
Copy link

Hudamp commented Jun 10, 2021

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

where to add the first code?

@AbhilashPurohith
Copy link

change RCTCxxBridge.mm in line number 624

NSArray<id> *)modules

to

*NSArray )modules

@Jackyaung
Copy link

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|
## Fix for XCode 12.5 beta
find_and_replace("../node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm",
"_initializeModules:(NSArray<id> *)modules", "_initializeModules:(NSArray *)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

@sbrighiu
Copy link

sbrighiu commented Jun 26, 2021

In some cases, you may also need this third one :)

post_install do |installer|
...
find_and_replace("../node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm",
"RCTBridgeModuleNameForClass(strongModule))",
"RCTBridgeModuleNameForClass(Class(strongModule)))")
end

@romreed
Copy link

romreed commented Jul 15, 2021

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.

Was heplful. Thank you.

@bullerliu
Copy link

post_install do |installer|
## Fix for XCode 12.5
find_and_replace("./RNLib/node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm",
"_initializeModules:(NSArray *)modules", "_initializeModules:(NSArray *)modules")
find_and_replace("./RNLib/node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm",
"RCTBridgeModuleNameForClass(module))", "RCTBridgeModuleNameForClass([module class]))")
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
end
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

这样写没有用

@oluoyefeso
Copy link

Having same problem here, but im at .61, the problem is with Xcode 12.5, the last version 12.4 didnt have this problem.
image

Experienced this same issue and this 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]))")


    find_and_replace("../node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm",
    "RCTBridgeModuleNameForClass(strongModule))",
    "RCTBridgeModuleNameForClass(Class(strongModule)))")

end

And at the 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

@luccaroli
Copy link

@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

it's worked for me, thanks

@facebook facebook locked as resolved and limited conversation to collaborators Oct 1, 2021
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Environment Info Please run `react-native info` and edit your issue with that command's output. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests