Closed gimi-anders closed 11 months ago
Facing the same issue with RN 0.72.5
. Though the console.log(Config) results in
{}`.
Anticipating you are using expo. Launch it with EXPO_NO_DOTENV=1
Anticipating you are using expo. Launch it with
EXPO_NO_DOTENV=1
@kulak91 No, I am not using expo.
I'm having the same issue with RN 0.72.5 (new arch not enabled). Has anyone found some solution or workaround ?
Same issue I'm running it with Expo & @kulak91 suggestion did not work.
I upgrade to RN 0.71.13 and then upgraded react-native-config from 1.4.6 to 1.5.1 at this point iOS Config became empty.
Downgrade react-native-config back to 1.4.6 and it started working again, Config was being returned as expected.
the same problem is happening in the android
https://github.com/luggit/react-native-config/issues/541#issuecomment-1491388207 I simply give permission to node_modules of read/write/execute . sudo chmod -R 777 node_modules/*
This hack gives us the idea that probably one of the files in the library doesn't have the correct permission. and seems like this is going to be related to Mac/Unix.
@Sahil6458 but giving access to all the files in the node_modules
is not a good idea, first of all we cannot force all our team members to use this method, and second, this is extremely dangerous
I'll try to check which file lacks the permission and publish a patch
@gimi-anders can you please tell us your OS and xcode version?
@vanenshi When I tried this the last time I was on OS 13 and xcode 14. I have now upgraded my OS and xcode, but I have not checked if that changes anything.
@gimi-anders i am using the xcode 15 and the same problem is happening, so its not related to the xcode version
the same problem is happening in the android. NativeModules.ReactNativeConfigModule it's null
I having the same in my app. Xcode Version: 15 react-native: 0.72.5
+1 Xcode 14.3.1 react-native 0.72.5 react-native-config 1.5.1
Like @kiwioz, downgrading to 1.4.6 restored function.
had same problem, turns out i missed this step in config https://github.com/luggit/react-native-config#app-extensions
Struggling with same issue from past two weeks, my error is in iOS build with error message "ReactNativeConfig.h" not found. Anyone got a real solution? Xcode 15 react-native 0.72.5 react-native-config 1.5.1 where the internal library name has changed to RNCConfig.h, (also tried 1.4.12 with old header file name ReactNativeConfig.h)
I having the same in my app. Xcode Version: 15 react-native: 0.72.5
This was an issue with the nx monorepo. After updating nx version the issue got resolved.
@vanenshi Any progress on this?
@vanenshi Any progress on this?
@gimi-anders sorry I caught up in some business related stuff and couldn't work on this. 🫠 My workaround was to detect the build type ("betaRelease" for example) and load the corresponding env manually (as a json file) Since our app don't need any native .env configuration, this solution was enough. 👌 Unfortunately, I won't be able to work on this issue. 🥲
Has anyone got this library working on RN 0.71 or 0.72?
Has anyone got this library working on RN 0.71 or 0.72?
Yes, i Have. I suspect the .env file location might be the issue for you. After the RN i need to change my ENVFILES location in the podfile
PS: I am using NX monorepo so my location of .env might look different from yours.
ENVFILES = {
'Debug' => '$(PODS_ROOT)/../../.env',
'Release' => '$(PODS_ROOT)/../../.env',
}
Has anyone got this library working on RN 0.71 or 0.72?
Yes, i Have. I suspect the .env file location might be the issue for you. After the RN i need to change my ENVFILES location in the podfile
PS: I am using NX monorepo so my location of .env might look different from yours.
ENVFILES = { 'Debug' => '$(PODS_ROOT)/../../.env', 'Release' => '$(PODS_ROOT)/../../.env', }
I will test this, but unfortunately this is not the complete solution, since I experience the same issue on both iOS and Android. Your suggestion only applies to iOS.
Ok folks, it seems like this was completely an issue due to a silly mistake on my side. I will post it here, maybe someone has done the same mistake.
I had named the react-native config file incorrectly to react-native-config.js
.
After giving it the correct name react-native.config.js
, the config works fine on both iOS and Android.
Case closed.
Ok folks, it seems like this was completely an issue due to a silly mistake on my side. I will post it here, maybe someone has done the same mistake.
I had named the react-native config file incorrectly to
react-native-config.js
. After giving it the correct namereact-native.config.js
, the config works fine on both iOS and Android.Case closed.
But why have you closed this issue if a bunch of people is facing the same problem? In my case it's on both, iOS and android.
The same here
i had the same problem, can someone help me. https://github.com/lugg/react-native-config/issues/792
This worked for me! https://github.com/lugg/react-native-config/issues/770#issuecomment-1672621798 ensure that you add your BuildConfig to your proguard rules. Took me hours to figure out. IMHO the README needs a major makeover. This should be pretty much on top it.
In your proguard-rules.pro add
-keep class my.app.package.BuildConfig { *; }
Note Obviously you need to adapt the package to your actual app package name (my.app.package)
Điều này đã hiệu quả với tôi! #770 (nhận xét) đảm bảo rằng bạn thêm BuildConfig vào quy tắc bảo vệ của mình. Tôi đã mất hàng giờ để tìm ra. IMHO README cần một sự thay đổi lớn. Điều này sẽ được khá nhiều trên đầu nó.
Trong proguard-rules.pro của bạn thêm
-keep class my.app.package.BuildConfig { *; }
Lưu ý Rõ ràng là bạn cần điều chỉnh gói phù hợp với tên gói ứng dụng thực tế của mình ( my.app.package )
it not work for me. Please help me! "react-native": "0.73.2", "react-native-config": "^1.5.1",
work perfect on Xcode version 15.3 react-native-config , version 1.5.1 react-native , version 0.73.6
If the config is returning undefined in IOS try this, it worked for me "react-native": "^0.71.0", "react-native-config": "1.4.6",
For IOS: Add this line to the top of the pod file pod 'react-native-config', :path => '../node_modules/react-native-config'
If the config is returning undefined in IOS try this, it worked for me "react-native": "^0.71.0", "react-native-config": "1.4.6",
For IOS: Add this line to the top of the pod file pod 'react-native-config', :path => '../node_modules/react-native-config'
Thanks
react-native: 0.71.13 react-native-config: 1.5.1
After upgrading react-native from 0.70.9 to 0.71.13, the config is empty.
This is what I get when I log config:
Output:
{"dependencies": {}}
I have tried downgrading to version 1.4 and 1.3, but that does not help.
I have set this in the pre-actions without success:
Note that it worked fine on RN 0.70.9. Any help would be appreciated.
Update: I am having the exact same issue on Android