react-native: [0.48.0]: Error: Redefinition of RCTMethodInfo

After upgrading from 0.47.2 -> 0.48.0, I can’t get XCode to build anymore. I’ve tried clearing out derived data, cleaning the project, etc. It’s consistently failing with this error, across various react-native-* modules I have installed.

screen shot 2017-09-03 at 3 46 44 pm

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 44
  • Comments: 39 (6 by maintainers)

Commits related to this issue

Most upvoted comments

as per latest document

pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'Core',
    **'DevSupport'**, # Include this to enable In-App Devmenu if RN >= 0.43
    'RCTText',
    'RCTNetwork',
    'RCTWebSocket', # needed for debugging
    # Add any other subspecs you want to use in your project
  ]

Adding DevSupport in Podfile fixed RCTDevMenu.h not found issue. As point out by others, Changing import "RCTBridgeModule.h" to import <React/RCTBridgeModule.h> fixed the RCTBridgeModule not found error.

Is this issue getting looked at by management upstairs? No tag or assignment, and this should be priority fix with a .2 release considering it’s build breaking.

Shouldn’t RN releases pass basic build tests before being released in the first place? 😢

I had the same issue from a Ble lib. If I change the imports from the header module from:


#import "RCTBridgeModule.h"
#import "RCTEventEmitter.h"

to:

#import <React/RCTBridgeModule.h>
#import <React/RCTEventEmitter.h>

it fix my problem.

React Native 0.48.1

Same issue here with a third party module

bildschirmfoto 2017-09-04 um 11 56 23

+1 - RCTDevMenu.h file not found

@kozillla I was right, you found that module, which conflicts with React Native. Whatever, the problem, that third-partly modules import React Native modules as #import "RCTBridgeModule.h" first and <React/RCTBridgeModule.h> as failback. But should be otherwise.

Same situation here: https://github.com/yonahforst/react-native-permissions/pull/138 P.S.: It was bad idea using <React/ namespace in 0.41.

Also possible to just add DevSupport instead of specifying all modules from the React pod:

  pod 'React', :path => '../node_modules/react-native'
  pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'DevSupport'
  ]

@kozillla I had the same issue. I dont know if its the correct way to fix the issue but here it is: change the React.podspec (node_modules/react-native) line " React/DevSupport/* " in ss.exclude_files of subspec “Core” to “React/DevSupport/*.{c,m,mm,S}”. Run pod install and should work.

To solve this issue I updated all my dependencies and link again. Then, I change all #import “RCTBridgeModule.h” to #import <React/RCTBridgeModule.h>.

Thanks for the comments everyone, I was able to get past this issue by using some code forks that the community has created the various third-party modules that are not yet compatible with RN 0.48.x. For me, it was these two:

"react-native-oauth": "git+ssh://git@github.com/exentrich/react-native-oauth#patch-1",
"react-native-permissions": "git+ssh://git@github.com/vinnyjth/react-native-permissions",

I will use these forks for now, until official fixes land on the master branch for these two projects.

Confirmed fix, with adding 'DevSupport' line to pod 'React' in Podfile fixes RCTDevMenu.h not found issue.

This needs to be better documented, as previous to RN 0.48, build didn’t break without the 'DevSupport' line in Podfile.

RCTDevMenu.h file not found is happening for me too, in RCTTVRemoteHandler.m

@grabbou please note that RN 0.48.1 seems to have fixed this issue’s original RCTMethodInfo error, but not error with RCTDevMenu.h. It’s persisting in 0.48.1 and is a showstopper with build failing

@exentrich clean project, rebuild [CMD] + [CTRL] + [SHIFT] + [K]