ui icon indicating copy to clipboard operation
ui copied to clipboard

Duplicate interface definition for class 'RCTView'

Open reason211 opened this issue 9 years ago • 10 comments

I follow the following steps to do step by step, but it can not be compiled successfully.

$ react-native init HelloWorld && cd HelloWorld

$ npm install --save @shoutem/ui

$ react-native link

$ react-native run-ios

2017-01-19 10 46 30-min

Build Environment: Xcode: Version 8.2.1 (8C1002) react-native": "0.40.0" node: v6.3.1 npm: 3.10.3

Is it because shoutem-ui does not support react-native 0.40.0 yet ?

reason211 avatar Jan 19 '17 14:01 reason211

I'm having issues with BVLinearGradient as well. RN 0.40 does introduce some breaking changes so it's likely that the shoutem team has not yet released a version that supports RN 0.40.

Can someone please confirm whether or not Shoutem UI and Animations support RN 0.40 and if not, when should we expect a new release?

Edit: Check this out - #124

tedjames avatar Jan 19 '17 22:01 tedjames

Solution Found

  1. Open your project in xcode and navigate to libraries/BVLinearGradient.xcodeproj/BVLinearGradient

  2. In each of the four files within that directory, you need to change a few import statements at the top of the file. Look for input statements with a prefix of RCT like:

#import "RCTBridge.h"
#import "RCTViewManager.h"
#import "RCTView.h"
  1. Now change each of those statements to this:
#import <React/RCTBridge.h>
#import <React/RCTViewManager.h>
#import <React/RCTView.h>

Moving forward you may discover that other libraries are giving you issues like this. Until these libraries are updated to work with the latest 0.40 release of react native, you'll have to continue with workarounds like this.

Simply put, you just need to reformat import statements for libraries prefixed with RCT from being enclosed like this: "{library name}" To being enclosed like this: <React/{library name} >

This fix should work for most other issues related to these breaking changes that came with 0.40. Version 4.0 of react-native-vector-icons and the latest version of react-native-share also fixed some issues that Shoutem/UI is currently facing. Just waiting on them to roll out a new update that includes these latest updates.

tedjames avatar Jan 20 '17 04:01 tedjames

@tedjames It works! Your help was greatly appreciated!

reason211 avatar Jan 20 '17 06:01 reason211

@tedjames You are a life saver :D thanks mate

imchathu87 avatar Jan 30 '17 06:01 imchathu87

Is this in 0.10.9? Getting similar errors in RN 0.41.2

benjick avatar Feb 22 '17 01:02 benjick

Getting the same errors in 0.41.2 too :( any idea when this is going to get pushed?

PoloGarcia avatar Feb 22 '17 19:02 PoloGarcia

Also, if you get a similar error in relation to the vector icons library. Thanks to the solution above, find the RNVectorIcons.xcodeproj/RNVectorIconsManager/RNVectorIconsManager.h, and replace:

#import "RCTLog.h"

with

#import <React/RCTLog.h>

Thanks, @tedjames

dekkofilms avatar Mar 14 '17 01:03 dekkofilms

Note that this is fixed in more recent versions of react-native-linear-gradient. In particular, version 2.0.0 solved it for me.

techrah avatar Mar 18 '17 23:03 techrah

Guys, there is 0.12.0-rc.1 available at npm with dist-tag rc so could you try it and verify does it fix this issue? On Sun, 19 Mar 2017 at 00:38, Ryan Homer [email protected] wrote:

Note that this is fixed in more recent versions of react-native-linear-gradient. In particular, version 2.0.0 solved it for me.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/shoutem/ui/issues/134#issuecomment-287583038, or mute the thread https://github.com/notifications/unsubscribe-auth/AEYJkbF0DJfKOF8ZfqCzcPfxEfgWX1i5ks5rnGrygaJpZM4LoMOm .

SoHotSoup avatar Mar 19 '17 09:03 SoHotSoup

#import "RCTBridge.h" #import "RCTViewManager.h" #import "RCTView.h"

@tedjames my files are already have statements like you mentioned but then also i m getting error

Rubanlycan avatar Feb 14 '21 13:02 Rubanlycan