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.48.0]: Error: Redefinition of RCTMethodInfo #15775

Closed
joncursi opened this Issue Sep 3, 2017 · 39 comments

Comments

Projects
None yet
@joncursi
Copy link
Contributor

joncursi commented Sep 3, 2017

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

@joncursi

This comment has been minimized.

Copy link
Contributor Author

joncursi commented Sep 3, 2017

FWIW, I downgraded to 0.47.2, cleared derived data, cleaned the project, and now I'm operational again. There's something funky going on in the new 0.48.0 release.

@fabriziogiordano

This comment has been minimized.

Copy link

fabriziogiordano commented Sep 3, 2017

Probably dupe for #15762

@joncursi

This comment has been minimized.

Copy link
Contributor Author

joncursi commented Sep 4, 2017

Hmm. I saw that but didn't think so because the project in #15762 actually compiles, and then crashes, whereas this straight up won't compile.

@grabbou

This comment has been minimized.

Copy link
Collaborator

grabbou commented Sep 4, 2017

Not a duplicate - I couldn't reproduce this issue.

@robertmerten

This comment has been minimized.

Copy link

robertmerten commented Sep 4, 2017

React Native 0.48.1

Same issue here with a third party module

bildschirmfoto 2017-09-04 um 11 56 23

@iegik

This comment has been minimized.

Copy link

iegik commented Sep 4, 2017

Previous definition is here: https://github.com/facebook/react-native/blob/master/React/Base/RCTBridgeModule.h#L54
First in commit: cb12080#diff-6dc01074330d7af8d99288cad5a021b7

Question: Should RCTMethodInfo to be defined "globally" in React/Base?

@iegik

This comment has been minimized.

Copy link

iegik commented Sep 4, 2017

Resolved, by changing import priority: yonahforst/react-native-permissions#137

@exentrich

This comment has been minimized.

Copy link
Contributor

exentrich commented Sep 4, 2017

Same issue

@iegik

This comment has been minimized.

Copy link

iegik commented Sep 4, 2017

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

@MatthieuPeyrot

This comment has been minimized.

Copy link

MatthieuPeyrot commented Sep 4, 2017

I fix the issue by changing in all my module who use #import "RCTBridgeModule.h" into #import <React/RCTBridgeModule.h> but it trigger an other issue

/node_modules/react-native/React/Base/RCTTVRemoteHandler.m:25:9: 'RCTDevMenu.h' file not found

@iegik

This comment has been minimized.

Copy link

iegik commented Sep 4, 2017

Fixed in #15783

@MatthieuPeyrot

This comment has been minimized.

Copy link

MatthieuPeyrot commented Sep 4, 2017

Even with this fix i try #import <React/RCTDevMenu.h> and #import "RCTDevMenu.h" clean rebuild nothing change i still have the issues and the parallelize build is disabled.

@iegik

This comment has been minimized.

Copy link

iegik commented Sep 4, 2017

@MatthieuPeyrot Please, review #15788

@MatthieuPeyrot

This comment has been minimized.

Copy link

MatthieuPeyrot commented Sep 4, 2017

@iegik Even with this I have RCTDevMenu.h file not found

@kozillla

This comment has been minimized.

Copy link

kozillla commented Sep 4, 2017

@iegik , I have applied your fix how ever it didnt work for me , still have redefinition of RCTMethodInfo,

@iegik

This comment has been minimized.

Copy link

iegik commented Sep 4, 2017

@kozillla do you have react-native-permissions in your project included?
https://github.com/yonahforst/react-native-permissions/pull/138/files

@kozillla

This comment has been minimized.

Copy link

kozillla commented Sep 4, 2017

@iegik no,I do not use it.

@jorgefspereira

This comment has been minimized.

Copy link

jorgefspereira commented Sep 4, 2017

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

@fungilation

This comment has been minimized.

Copy link

fungilation commented Sep 4, 2017

Same error here with RCTDevMenu.h, when upgraded RN from 0.47 to 0.48.1. From XCode:

[project]/node_modules/react-native/React/Base/RCTTVRemoteHandler.m:25:9: 'RCTDevMenu.h' file not found

@jorgefspereira's workaround works and my app builds! Though obviously not a proper fix.

@fungilation

This comment has been minimized.

Copy link

fungilation commented Sep 4, 2017

@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

@kozillla

This comment has been minimized.

Copy link

kozillla commented Sep 4, 2017

@jorgefsereira thx for sugestion but I dont use pods to manage react-native, also problem persist in RN 0.48.1

@iegik

This comment has been minimized.

Copy link

iegik commented Sep 5, 2017

@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: yonahforst/react-native-permissions#138
P.S.: It was bad idea using <React/ namespace in 0.41.

@kinber95

This comment has been minimized.

Copy link

kinber95 commented Sep 5, 2017

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.

@iegik

This comment has been minimized.

Copy link

iegik commented Sep 5, 2017

@kozillla

This comment has been minimized.

Copy link

kozillla commented Sep 5, 2017

@iegik ,thanks for pointing issue, you are right, fixing import sequence in third part modules resolve this problem

@fhadsheikh

This comment has been minimized.

Copy link

fhadsheikh commented Sep 5, 2017

+1 - RCTDevMenu.h file not found

@arminsal1

This comment has been minimized.

Copy link

arminsal1 commented Sep 5, 2017

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

@fungilation

This comment has been minimized.

Copy link

fungilation commented Sep 6, 2017

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? 😢

tamagokun added a commit to tamagokun/react-native-event-bridge that referenced this issue Nov 8, 2017

Switch RN module import fallbacks
See this issue for reference: facebook/react-native#15775 (comment)

Seems like React doesn't like it when the fallback is the *new* import, the fallback should be the old way.

maicki added a commit to maicki/react-native-event-bridge that referenced this issue Nov 8, 2017

Switch RN module import fallbacks (#18)
See this issue for reference: facebook/react-native#15775 (comment)

Seems like React doesn't like it when the fallback is the *new* import, the fallback should be the old way.

spearmootz added a commit to spearmootz/react-native-pinch that referenced this issue Dec 7, 2017

make compatible with rn 48.1+
this would not build in react-native 48.1+

its related to this facebook/react-native#15775

jfaris added a commit to Thinkspan/react-native-dropbox-chooser that referenced this issue Jan 3, 2018

browniefed added a commit to tinycreative/react-native-dropbox-chooser that referenced this issue Jan 4, 2018

@pincheira

This comment has been minimized.

Copy link

pincheira commented Feb 25, 2018

@joncursi are you still using the patched version for react-native-oauth? Cheers!

@joncursi

This comment has been minimized.

Copy link
Contributor Author

joncursi commented Feb 26, 2018

@andela-cofor

This comment has been minimized.

Copy link

andela-cofor commented Mar 11, 2018

@iegik I get ld: framework not found DCTAuth

@prateekm33

This comment has been minimized.

Copy link

prateekm33 commented Mar 27, 2018

FWIW I made the change shown here : yonahforst/react-native-permissions#137

It didn't work. So I reverted the changes, rebuilt, and the app is running now. Ofc, I also had manually linked libOAuthManager.a prior to all of this.

mraucorp added a commit to mraucorp/react-native-image-cropping that referenced this issue Apr 9, 2018

fix "Error: Redefinition of RCTMethodInfo"
following facebook/react-native#15775
and this PR - https://github.com/nico1510/react-native-image-crop-picker/pull/9/files

it works for me this way
i am not sure about the right order for TOCropView.h, just kept it between

TomMahle added a commit to TomMahle/react-native-exception-handler that referenced this issue Apr 9, 2018

Change import priority of RCTBridgeModule
This appears to be the accepted fix for this issue: master-atul#46 per facebook/react-native#15775 (comment) and other posts in the same thread.

EricWiener added a commit to EricWiener/react-native-image-cropping that referenced this issue Jun 30, 2018

Changed import of RCTBridgeModule
This is to correspond with React Native 0.48. It no longer works with #import "RCTBridgeModule.h" (see this issue: facebook/react-native#15775). This fixes issue.

darji89 referenced this issue in XiteTV/react-native-tvos-controller Aug 7, 2018

@chandanyadav7

This comment has been minimized.

Copy link

chandanyadav7 commented Aug 11, 2018

just write
#ifndef CODE
#define CODE // at the top of the file
.
.
.
.
#endif //at last

@aino-gautam

This comment has been minimized.

shalin-jasani added a commit to shalin-jasani/react-native-oauth that referenced this issue Sep 10, 2018

Merge fullstackreact/react-native-oauth master branch into shalin-jas…
…ani/fullstackreact/react-native-oauth master branch (#1)

* Added fullstackreact#171
and my NSString *clientID fix, which might not be as good as
https://github.com/fullstackreact/react-native-oauth/blob/2f8c8d1483526bbc8a6ca72183c6d11a71538ad3/ios/OAuthManager/OAuthManager.m

* Added fullstackreact#171
and my NSString *clientID fix, which might not be as good as
https://github.com/fullstackreact/react-native-oauth/blob/2f8c8d1483526bbc8a6ca72183c6d11a71538ad3/ios/OAuthManager/OAuthManager.m

* Added fullstackreact#171
and my NSString *clientID fix, which might not be as good as
https://github.com/fullstackreact/react-native-oauth/blob/2f8c8d1483526bbc8a6ca72183c6d11a71538ad3/ios/OAuthManager/OAuthManager.m

* Merge PR 121, fix user agent, fix full screen webview

* Changed if/else statement to avoid React error.

* Fix duplicate RCTMethodInfo import (facebook/react-native#15775) (yonahforst/react-native-permissions#137)

* Fix duplicate React library import error conflict w/certain pods

* Pass back response headers over javascript bridge

* Dispatch safariViewController on main queue

The safariViewController dispatch was occuring on another thread.
This sometimes caused app crashes when the view was presented,
in particular if the keyboard had been presented via a TextInput or
other component. The resulting crash complained about
_cachedSystemAnimationFence and the main thread. This has been with
other React Native apps that load a viewController.

Dispatching to present the viewController on the main thread fixes this
issue.

* Fix build issue

* Remove deprecated @override

* Fix: Duplicate RCTMethodInfo while building iOS app

* Fix error for redefinition of RCTMethodInfo

* Ignored dist/

* 2.1.16

* 2.1.17

* 2.1.18

@facebook facebook locked as resolved and limited conversation to collaborators Sep 11, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.