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
Closed

[0.48.0]: Error: Redefinition of RCTMethodInfo #15775

joncursi opened this issue Sep 3, 2017 · 39 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@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
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
Copy link

Probably dupe for #15762

@joncursi
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
Copy link
Contributor

grabbou commented Sep 4, 2017

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

@robertmerten
Copy link

React Native 0.48.1

Same issue here with a third party module

bildschirmfoto 2017-09-04 um 11 56 23

@iegik
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
Copy link

iegik commented Sep 4, 2017

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

@exentrich
Copy link

Same issue

@iegik
Copy link

iegik commented Sep 4, 2017

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

@MatthieuPeyrot
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
Copy link

iegik commented Sep 4, 2017

Fixed in #15783

@MatthieuPeyrot
Copy link

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
Copy link

iegik commented Sep 4, 2017

@MatthieuPeyrot Please, review #15788

@MatthieuPeyrot
Copy link

MatthieuPeyrot commented Sep 4, 2017

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

@kozillla
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
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
Copy link

kozillla commented Sep 4, 2017

@iegik no,I do not use it.

@jorgefspereira
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
Copy link

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

@kinber95
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
Copy link

iegik commented Sep 5, 2017

@kozillla
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
Copy link

+1 - RCTDevMenu.h file not found

@arminsal1
Copy link

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

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

cpunion added a commit to cpunion/react-native-netease-im that referenced this issue Nov 6, 2017
升级到 [email protected] 以后,出现 facebook/react-native#15775 这个问题,调整顺序后解决。
cpunion added a commit to cpunion/react-native-netease-im that referenced this issue Nov 8, 2017
升级到 [email protected] 以后,出现 facebook/react-native#15775 这个问题,调整顺序后解决。
tamagokun added a commit to tamagokun/react-native-event-bridge that referenced this issue Nov 8, 2017
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
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 pushed a commit to tinycreative/react-native-dropbox-chooser that referenced this issue Jan 4, 2018
@pincheira
Copy link

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

@joncursi
Copy link
Contributor Author

joncursi commented Feb 26, 2018 via email

@andela-cofor
Copy link

@iegik I get ld: framework not found DCTAuth

@therealcritiq
Copy link

FWIW I made the change shown here : zoontek/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
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
This appears to be the accepted fix for this issue: a7ul#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
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.
ruen89 referenced this issue in XiteTV/react-native-tvos-controller Aug 7, 2018
@chandanyadav7
Copy link

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

@aino-gautam
Copy link

shalin-jasani added a commit to shalin-jasani/react-native-oauth that referenced this issue Sep 10, 2018
…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) (zoontek/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
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Sep 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests