Closed jeremy303 closed 1 year ago
@HolySamosa have you found any solution?
Having the same issue. Seems like either this library have to rename the class or RN have to rename the class 🤔
Having the same issue. Seems like either this library have to rename the class or RN have to rename the class 🤔
Unfortunately, I had to disable the "native" usage of this lib and hard-coded some values in the native part of app (for our iOS Widget) 😢
Not an expert on this topic but I think the problem comes from this mechanism:
Name conflicts between dynamic shared libraries are not discovered at compile time, link time, or runtime. The dlsym function uses string matching to find symbols. If two libraries use the same name for a function, the dynamic loader returns the first one that matches the symbol name given to dlsym.
Without being 100% sure, I guess the author here should probably "alias" the class. I guess the package is not named properly since the origin:
A good way to solve collision problems in Objective-C is adopt a prefix to differentiate your class name from other class names, and this is the technique already used by Apple itself, lets think about the array class, it is called NSArray [...] https://stackoverflow.com/a/12880582
Or maybe move the library to Swift, which supports namespacing :)
I wish I had skills to offer a fix!
@pedro @luancurti any solution for this. I can't build my app due this on 0.69.1
the error still there
There is no fix unless you fork this and rename. The author will need to rename the package/podspec because of the name clash with newer versions of react which introduced a "ReactNativeConfig" package in 0.68 and higher.
Feel free to make a pull request @exs6350 with this solution
Hi @luancurti , if we need to rename the package/podspec to fix the issue, do you have any preferences what the new package should be called?
Sorry, I thought I had long ago replied with my work around. In my case, I've opted out of the "new architecture" for the time being, and I commented out all code in the RCT_NEW_ARCH_ENABLED code blocks.
Also, regarding preferences for the new name, might I suggest TheRealReactNativeConfig
. ;-)
My poor attempt at humor aside, Apple recommends using 3 letter prefixes for class names.
So RNC
as a prefix seems to be a natural choice.
@philpettican118 @luancurti
@pedro @luancurti please see PR changes. I added an example 0.68.5 project for Android and iOS which seem to work as expected. I don't have access to windows though so I haven't added an example project or been able to test on windows.
This is so awesome. Thanks @philpettican118, for your great work! 🍺
React Native 0.68 iOS introduces
<react/config/ReactNativeConfig.h>
inAppDelegate.mm
as part of optional new-architecture support, conflicting with react-native-config'sReactNativeConfig.h
.It seems the docs should be updated to make it clear these are different classes and provide an example of how to work around the name collision.
Thanks!