react-native-file-opener icon indicating copy to clipboard operation
react-native-file-opener copied to clipboard

ios Build fail with react-native .48.3

Open amitbravo opened this issue 7 years ago • 5 comments

This kind of issue I also got earlier with react-native-image-crop-picker recently after .48.0 , they updated library and issue is solved now, similar issue I get with react-native-file-opener too.

In file included from /Applications/myproject/node_modules/react-native-file-opener/ios/RNFileOpener/RNFileOpener.m:1: In file included from /Applications/myproject/node_modules/react-native-file-opener/ios/RNFileOpener/RNFileOpener.h:2: In file included from ../../react-native/React/Base/RCTBridge.h:13: /Applications/myproject/ios/build/Build/Products/Debug-iphonesimulator/include/React/RCTBridgeModule.h:54:16: error: redefinition of 'RCTMethodInfo' typedef struct RCTMethodInfo { ^ In file included from /Applications/myproject/node_modules/react-native-file-opener/ios/RNFileOpener/RNFileOpener.m:1: In file included from /Applications/myproject/node_modules/react-native-file-opener/ios/RNFileOpener/RNFileOpener.h:1: ../../react-native/React/Base/RCTBridgeModule.h:54:16: note: previous definition is here typedef struct RCTMethodInfo { ^ In file included from /Applications/myproject/node_modules/react-native-file-opener/ios/RNFileOpener/RNFileOpener.m:1: In file included from /Applications/myproject/node_modules/react-native-file-opener/ios/RNFileOpener/RNFileOpener.h:2: In file included from ../../react-native/React/Base/RCTBridge.h:13: /Applications/myproject/ios/build/Build/Products/Debug-iphonesimulator/include/React/RCTBridgeModule.h:58:3: error: typedef redefinition with different types ('struct (anonymous struct at /Applications/myproject/ios/build/Build/Products/Debug-iphonesimulator/include/React/RCTBridgeModule.h:54:16)' vs 'struct RCTMethodInfo') } RCTMethodInfo; ^ In file included from /Applications/myproject/node_modules/react-native-file-opener/ios/RNFileOpener/RNFileOpener.m:1: In file included from /Applications/myproject/node_modules/react-native-file-opener/ios/RNFileOpener/RNFileOpener.h:1: ../../react-native/React/Base/RCTBridgeModule.h:58:3: note: previous definition is here } RCTMethodInfo; ^ In file included from /Applications/myproject/node_modules/react-native-file-opener/ios/RNFileOpener/RNFileOpener.m:1: In file included from /Applications/myproject/node_modules/react-native-file-opener/ios/RNFileOpener/RNFileOpener.h:2: In file included from ../../react-native/React/Base/RCTBridge.h:13: /Applications/myproject/ios/build/Build/Products/Debug-iphonesimulator/include/React/RCTBridgeModule.h:65:11: warning: duplicate protocol definition of 'RCTBridgeModule' is ignored @protocol RCTBridgeModule <NSObject> ^ In file included from /Applications/myproject/node_modules/react-native-file-opener/ios/RNFileOpener/RNFileOpener.m:1: In file included from /Applications/myproject/node_modules/react-native-file-opener/ios/RNFileOpener/RNFileOpener.h:1: ../../react-native/React/Base/RCTBridgeModule.h:65:11: note: previous definition is here @protocol RCTBridgeModule <NSObject> ^ /Applications/myproject/node_modules/react-native-file-opener/ios/RNFileOpener/RNFileOpener.m:29:30: warning: assigning to 'id<UIDocumentInteractionControllerDelegate> _Nullable' from incompatible type 'FileOpener *const __strong' self.FileOpener.delegate = self;

amitbravo avatar Sep 20 '17 12:09 amitbravo

Hi, I notice that this repository is not updated.

The latest code on master is broken, so I decided to fork the repository and create a new build package, this package is just a workaround until the problems are solved on this repository.

Install react-native-file-opener-fix, it is only adding the solution for the above issue

lchapoy avatar Sep 21 '17 21:09 lchapoy

Do I need to uninstall react-native-file-opener first before installing react-native-file-opener-fix ?

amitbravo avatar Oct 17 '17 18:10 amitbravo

Yes, the fix should replace the original.

So you are going to import fix, I know that the name is confusing but it is really the same than the origina with the fix dependency so that the project could work on new react-native

On Oct 17, 2017 1:51 PM, Andrew [email protected] wrote:

Do I need to uninstall react-native-file-opener first before installing react-native-file-opener-fix ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/huangzuizui/react-native-file-opener/issues/22#issuecomment-337331687, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AOVy-EE-B5kFKr32D2FrhBpY8Be8CaQrks5stPcdgaJpZM4PdyOc.

lchapoy avatar Oct 17 '17 19:10 lchapoy

The file should validate if RCTBridgeModule is already loaded. The file is: RNFileOpener/RNFileOpener.h

Should be like:

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

@import UIKit; (...)

Good luck.

marcioaso avatar Feb 01 '18 14:02 marcioaso

Thanks @marcioaso

kadiryaka avatar Dec 05 '18 13:12 kadiryaka