-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build error on 0.71.2: 'RNUltimateConfigSpec.h' file not found #130
Comments
Hi @dennisvk001 , I'll investigate the issue and work to solve the problem as soon as possible. |
Are there any updates here that have the same issue with RN 0.71.11 (new architecture included)? |
Am facing the same issue with rn 72 (new architecture enabled) |
I am facing the same issue with 72 and the new architecture enabled. |
This seems to relate to Codegen process, but I could be wrong. |
Still happens with RN 73 and new architecture enabled.
|
The Codegen part was missing. I did some quick exercise to add it. I had to add the codegen section to Here is the patch made with diff --git a/ios/UltimateConfig.h b/ios/UltimateConfig.h
index 41ad9efb55a3fd96986a49ef9e369e5b6271e328..2c3004d99238d8a3c2dbcebdc63838cd068af46f 100644
--- a/ios/UltimateConfig.h
+++ b/ios/UltimateConfig.h
@@ -1,6 +1,6 @@
#ifdef RCT_NEW_ARCH_ENABLED
-#import "RNUltimateConfigSpec.h"
+#import "RNUltimateConfig/RNUltimateConfig.h"
@interface UltimateConfig : NSObject <NativeUltimateConfigSpec>
#else
diff --git a/ios/UltimateConfig.m b/ios/UltimateConfig.m
deleted file mode 100644
index 7debfdff0402385a71111c72517799ec25128e8d..0000000000000000000000000000000000000000
--- a/ios/UltimateConfig.m
+++ /dev/null
@@ -1,26 +0,0 @@
-#import "UltimateConfig.h"
-#import "ConfigValues.h"
-
-@implementation UltimateConfig
-RCT_EXPORT_MODULE()
-
-+ (BOOL)requiresMainQueueSetup
-{
- return YES;
-}
-
-- (NSDictionary *)constantsToExport
-{
- return getValues();
-}
-
-// Don't compile this code when we build for the old architecture.
-#ifdef RCT_NEW_ARCH_ENABLED
-- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
- (const facebook::react::ObjCTurboModule::InitParams &)params
-{
- return std::make_shared<facebook::react::NativeUltimateConfigSpecJSI>(params);
-}
-#endif
-
-@end
diff --git a/ios/UltimateConfig.mm b/ios/UltimateConfig.mm
new file mode 100644
index 0000000000000000000000000000000000000000..7debfdff0402385a71111c72517799ec25128e8d
--- /dev/null
+++ b/ios/UltimateConfig.mm
@@ -0,0 +1,26 @@
+#import "UltimateConfig.h"
+#import "ConfigValues.h"
+
+@implementation UltimateConfig
+RCT_EXPORT_MODULE()
+
++ (BOOL)requiresMainQueueSetup
+{
+ return YES;
+}
+
+- (NSDictionary *)constantsToExport
+{
+ return getValues();
+}
+
+// Don't compile this code when we build for the old architecture.
+#ifdef RCT_NEW_ARCH_ENABLED
+- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
+ (const facebook::react::ObjCTurboModule::InitParams &)params
+{
+ return std::make_shared<facebook::react::NativeUltimateConfigSpecJSI>(params);
+}
+#endif
+
+@end
diff --git a/ios/UltimateConfig.xcodeproj/project.pbxproj b/ios/UltimateConfig.xcodeproj/project.pbxproj
index 9ec0fd89049bbcf2c75ca18cd7b489a06048ea11..ad1fec12fbc7d2d9020e98f9658ed9dd3df5fc80 100644
--- a/ios/UltimateConfig.xcodeproj/project.pbxproj
+++ b/ios/UltimateConfig.xcodeproj/project.pbxproj
@@ -7,7 +7,7 @@
objects = {
/* Begin PBXBuildFile section */
- 5E555C0D2413F4C50049A1A2 /* UltimateConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* UltimateConfig.m */; };
+ 5E555C0D2413F4C50049A1A2 /* UltimateConfig.mm in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* UltimateConfig.mm */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
@@ -25,7 +25,7 @@
/* Begin PBXFileReference section */
134814201AA4EA6300B7C361 /* libUltimateConfig.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libUltimateConfig.a; sourceTree = BUILT_PRODUCTS_DIR; };
B3E7B5881CC2AC0600A0062D /* UltimateConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UltimateConfig.h; sourceTree = "<group>"; };
- B3E7B5891CC2AC0600A0062D /* UltimateConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UltimateConfig.m; sourceTree = "<group>"; };
+ B3E7B5891CC2AC0600A0062D /* UltimateConfig.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UltimateConfig.mm; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -51,7 +51,7 @@
isa = PBXGroup;
children = (
B3E7B5881CC2AC0600A0062D /* UltimateConfig.h */,
- B3E7B5891CC2AC0600A0062D /* UltimateConfig.m */,
+ B3E7B5891CC2AC0600A0062D /* UltimateConfig.mm */,
134814211AA4EA7D00B7C361 /* Products */,
);
sourceTree = "<group>";
@@ -113,7 +113,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- B3E7B58A1CC2AC0600A0062D /* UltimateConfig.m in Sources */,
+ B3E7B58A1CC2AC0600A0062D /* UltimateConfig.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/package.json b/package.json
index 6d116ba0f8e34c1671a75ef86df2627e46485892..2b03a617ba86f5caa128e0c96f1a4b5002ec2113 100644
--- a/package.json
+++ b/package.json
@@ -72,5 +72,13 @@
"resolutions": {
"logkitty": "^0.7.1",
"lodash": "^4.17.19"
+ },
+ "codegenConfig": {
+ "android": {
+ "javaPackageName": "com.reactnativeultimateconfig"
+ },
+ "name": "RNUltimateConfig",
+ "type": "all",
+ "jsSrcsDir": "./src/specs"
}
}
diff --git a/src/specs/NativeUltimateConfig.js b/src/specs/NativeUltimateConfig.js
new file mode 100644
index 0000000000000000000000000000000000000000..15a3f85e9f77ed67c209272e140b8e71d04e0fa3
--- /dev/null
+++ b/src/specs/NativeUltimateConfig.js
@@ -0,0 +1,10 @@
+// @flow
+import type {TurboModule} from 'react-native/Libraries/TurboModule/RCTExport';
+import {TurboModuleRegistry} from 'react-native';
+
+export interface Spec extends TurboModule {
+ getConstants: () => {||}
+}
+export default (TurboModuleRegistry.get<Spec>(
+ 'RNUltimateConfig'
+): ?Spec);
\ No newline at end of file But using of new architecture for such a simple native code is very questionable, imo. 🤔 Even with the new bridgeless mode of RN there is some emulation of old module system and for such a simple module which just returns constants there is no benefit of using JSI or having a delayed initialization of the module itself. I'd just remove the new arch things, if the package still compiles when the app has the new architecture enabled and the bridgeless mode turned on. |
@zubko Hello, I have followed the steps you have done and created a patch file after but now I get the error "cannot find file RNUltimateConfig/RNUltimateConfig.h" inside UltimateConfig.h. Any suggestions? I don't really have experience in changing packages |
Sorry to read this one didn't work straight. Maybe RN version is different or smth and now codegen is a bit different. I stopped using new architecture on that project pretty soon - there were just too many random crashes. And I'm still on the old one everywhere, so I can't do a quick check. I'd check if another import would work - for example just I would also try to remove all the new arch files from this library and make a patch for it. Maybe there is already some automatic "adaptor" to use an old arch library on a new arch project. I'm not aware of the status of this, if such thing was included already in a newer RN version. As I wrote - after a few initial configuration bumps and then some weird crashes deep inside the framework's native code I'm really not rushing towards the new arch. 🤷🏼♂️ But I keep using this package heavily, it's really much more superior to |
This patch builds with RN 0.75.4.
|
Is there any update on this issue? Are there any plans to migrate this library to support the new architecture? |
Hey, this is what I meant of rather removing any support of the new architecture so RN could apply some compatibility layer to it (hopefully). You could not say this lib doesn't support new architecture at all, it's just that the new arch config is a moving target and the config is outdated here. I've tested this patch now with RN 76.2 and new architecture enabled. react-native-ultimate-config+6.0.1.patch ... I wonder why does this lib need to pass the constants from the native layer to JS instead of just always generating them for the JS (like the override setting does or like it does for react-native-web case). Maybe some security considerations as it will be harder to get those values from native binaries than from the Hermes bundle. Otherwise, this all could be greatly simplified. We need these configs on the native side for sure, but I don't think we really need that connection between native and JS. |
Hi,
I am having the next problem while building project with RN 0.71.2 (new architecture enabled ):
In file included from ..UltimateConfig.m:1:
..UltimateConfig.h:3:9: fatal error: 'RNUltimateConfigSpec.h' file not found
Ultimate Config Version: "6.0.0"
I didnt found this file in sources, so i suppose it was not generated.
The text was updated successfully, but these errors were encountered: