birdofpreyru / react-native-fs

File system access for React Native
https://dr.pogodin.studio/docs/react-native-file-system
Other
121 stars 8 forks source link

Failed while installing on RN0.73.4 #30

Closed RohithBhandaru closed 3 months ago

RohithBhandaru commented 4 months ago

Hi,

I'm trying to install v2.24.1 in a RN0.73.4 based project. When i try to install pods, I get the following error clang: error: linker command failed with exit code 1 (use -v to see invocation). If I need to provide more details, let me know. I'm also facing a challenge as to how to install this library in a Kotlin based RN Android app.

Am not sure how to approach this. Any help is appreciated!

And thank you for this fork and your effort.

birdofpreyru commented 4 months ago

Without any specific details my first guess is that your issue has nothing to do with this library. It does not require any special setup, beside installing the npm package and (in case of iOS) running pod install. There is Example App, you may start checking whether that works for you.

aalshberi commented 3 months ago

I'm getting the same issue with RN 0.73.6 and latest XCode. I'm seeing duplicate symbols before the linker command failed reported here. I think it's because some 3rd party libs require the original react-native-fs and the original lib cannot coexist with this lib.

birdofpreyru commented 3 months ago

@aalshberi

the original lib cannot coexist with this lib

I believe, it is true, as it was noted in https://github.com/birdofpreyru/react-native-static-server/issues/65, but I don't remember details, why exactly. Anyway, investing my time into making this lib compatible with the original lib in the same project is not on the table, and it would be of a little value anyway, considering problems of the original lib with the latest RN versions.

I think it's because some 3rd party libs require the original react-native-fs

Perhaps, run npm list react-native-fs (or whatever equivalent command is for the package manager you use) and verify in the dependency tree if that is the case?

Also, did it work for you prior to RN 0.73.6 (which I haven't tried with this lib yet, I think the last one was definitely working for me with it was 0.73.4)?

liamjones commented 3 months ago

I believe, it is true, as it was noted in https://github.com/birdofpreyru/react-native-static-server/issues/65, but I don't remember details, why exactly.

I think it'll be down to Objective-C's lack of namespacing. There's only a single global namespace so you cannot have two ReactNativeFs classes at the same time.

This is why it's recommended you have a prefix for your names (which this module doesn't currently do AFAIK): https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/Conventions/Conventions.html

birdofpreyru commented 3 months ago

Yeah, it sounds about right. Anyway, as I said, making sure this library may work alongside the stale original one is out of the question, thus closing the issue.