Previous definition is in the react-native-codegen generated file.
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateModuleObjCpp
*
* We create an umbrella header (and corresponding implementation) here since
* Cxx compilation in BUCK has a limitation: source-code producing genrule()s
* must have a single output. More files => more genrule()s => slower builds.
*/
#ifndef __cplusplus
#error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm.
#endif
#import <Foundation/Foundation.h>
#import <RCTRequired/RCTRequired.h>
#import <RCTTypeSafety/RCTConvertHelpers.h>
#import <RCTTypeSafety/RCTTypedModuleConstants.h>
#import <React/RCTBridgeModule.h>
#import <React/RCTCxxConvert.h>
#import <React/RCTManagedPointer.h>
#import <ReactCommon/RCTTurboModule.h>
#import <optional>
#import <vector>
@protocol NativeRNLocalizeSpec <RCTBridgeModule, RCTTurboModule>
- (NSString *)getCalendar;
- (NSString *)getCountry;
- (NSArray<NSString *> *)getCurrencies;
- (NSArray<NSDictionary *> *)getLocales;
- (NSDictionary *)getNumberFormatSettings;
- (NSString *)getTemperatureUnit;
- (NSString *)getTimeZone;
- (NSNumber *)uses24HourClock;
- (NSNumber *)usesMetricSystem;
- (NSNumber * _Nullable)usesAutoDateAndTime;
- (NSNumber * _Nullable)usesAutoTimeZone;
@end
namespace facebook {
namespace react {
/**
* ObjC++ class for module 'NativeRNLocalize'
*/
class JSI_EXPORT NativeRNLocalizeSpecJSI : public ObjCTurboModule {
public:
NativeRNLocalizeSpecJSI(const ObjCTurboModule::InitParams ¶ms);
};
} // namespace react
} // namespace facebook
This line class JSI_EXPORT NativeRNLocalizeSpecJSI : public ObjCTurboModule
@alexanderoskin It does not result in an error on my side (I can compile the app without any error), but as it's already imported in the header file, it can be removed. Fixed in 3.0.4.
Bug summary
Related to https://github.com/zoontek/react-native-localize/issues/229
Redefinition of 'NativeRNLocalizeSpecJSI' during iOS build when new arch enabled. Redefinition comes from this lines https://github.com/zoontek/react-native-localize/blob/36b74d3bade1e7be8f7be134c2eb8816d75953fc/ios/RNLocalize.mm#L3C1-L5C7
Previous definition is in the react-native-codegen generated file.
This line
class JSI_EXPORT NativeRNLocalizeSpecJSI : public ObjCTurboModule
Library version
3.0.3
Environment info
Steps to reproduce
Reproducible sample code