react-native-file-opener
react-native-file-opener copied to clipboard
ios Build fail with react-native .48.3
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;
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
Do I need to uninstall react-native-file-opener first before installing react-native-file-opener-fix ?
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.
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.
Thanks @marcioaso