shoutem / ui

Customizable set of components for React Native applications
Other
4.9k stars 454 forks source link

Duplicate interface definition for class 'RCTView' #134

Closed reason211 closed 7 years ago

reason211 commented 7 years ago

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 ?

tedjames commented 7 years ago

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 commented 7 years ago

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"
  3. 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.

reason211 commented 7 years ago

@tedjames It works! Your help was greatly appreciated!

imchathu87 commented 7 years ago

@tedjames You are a life saver :D thanks mate

benjick commented 7 years ago

Is this in 0.10.9? Getting similar errors in RN 0.41.2

PoloGarcia commented 7 years ago

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

dekkofilms commented 7 years ago

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

techrah commented 7 years ago

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

SoHotSoup commented 7 years ago

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 notifications@github.com 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 .

Rubanlycan commented 3 years ago

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