Manspof
Manspof

Reputation: 357

React Native Error: Redefinition of RCTMethodInfo after installing the plugin

I opened a new react-native project (latest version V0.49) and after installing the plugin react-nfc-manager, I'm trying to run on ios with XCode 9 (simulators I test:IPHONE 6,7,7s IOS 11) it failed with error: enter image description here

when I run on android it works fine.

Upvotes: 3

Views: 4139

Answers (2)

Eric Wiener
Eric Wiener

Reputation: 5987

If this issue is being caused by a third party package, this can be fixed by searching for #import "RCTBridgeModule.h" in the third party library you are trying to use (in the file NameOfLibrary.h) and replace it with #import <React/RCTBridgeModule.h>.

Upvotes: 13

Manspof
Manspof

Reputation: 357

okay I found solution. to change the order of the imports

     #if __has_include(<React/RCTBridgeModule.h>)
     #import <React/RCTBridgeModule.h>
     else
     #import "RCTBridgeModule.h"
     #endif

Upvotes: 4

Related Questions