Comments (31)
I having the same in my app.
Xcode Version: 15
react-native: 0.72.5
from react-native-config.
Facing the same issue with RN 0.72.5
. Though the console.log(Config) results in
{}`.
from react-native-config.
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.
from react-native-config.
Has anyone got this library working on RN 0.71 or 0.72?
from react-native-config.
@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.
from 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'
from react-native-config.
Anticipating you are using expo. Launch it with EXPO_NO_DOTENV=1
from react-native-config.
Anticipating you are using expo. Launch it with
EXPO_NO_DOTENV=1
@kulak91 No, I am not using expo.
from react-native-config.
I'm having the same issue with RN 0.72.5 (new arch not enabled). Has anyone found some solution or workaround ?
from react-native-config.
Same issue I'm running it with Expo & @kulak91 suggestion did not work.
from react-native-config.
the same problem is happening in the android
from react-native-config.
from react-native-config.
#541 (comment)
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
from react-native-config.
@gimi-anders can you please tell us your OS and xcode version?
from react-native-config.
@gimi-anders i am using the xcode 15 and the same problem is happening, so its not related to the xcode version
from react-native-config.
the same problem is happening in the android. NativeModules.ReactNativeConfigModule it's null
from react-native-config.
+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.
from react-native-config.
had same problem, turns out i missed this step in config https://github.com/luggit/react-native-config#app-extensions
from react-native-config.
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)
from react-native-config.
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.
from react-native-config.
@vanenshi Any progress on this?
from react-native-config.
@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. 🥲
from react-native-config.
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',
}
from react-native-config.
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.
from react-native-config.
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.
from react-native-config.
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.
from react-native-config.
The same here
from react-native-config.
i had the same problem, can someone help me.
#792
from react-native-config.
This worked for me!
#770 (comment)
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)
from react-native-config.
Đ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",
from react-native-config.
work perfect on Xcode version 15.3
react-native-config , version 1.5.1
react-native , version 0.73.6
from react-native-config.
Related Issues (20)
- "/tmp/envfile" is buggy when its contents are empty string (iOS)
- Cannot invoke method toInteger() on null object HOT 2
- Inconsistent Environment File Loading in Android Studio vs React Native CLI
- ERROR in ./src/CONFIG.ts 3:0-41 [web-server] Module not found: Error: Can't resolve 'react-native-config' in '/Volumes/Personal/code-work/rn-projects/zaions/expensify-app-fork/src'
- is it possible to pass params but not set ENVFILE when run assemble release HOT 1
- How to import NSExceptionDomains as an environment variable?
- Variable are UNDEFINED on IOS HOT 14
- Could not find method android() for arguments [dotenv_4bgzrl46y7i0xnvnmgzr6qa4c$_run_closure1@3fa75e8b] on project ':app' of type org.gradle.api.Project.
- How to read config in Kotlin class in react native 0.73? HOT 1
- RNConfig Empty Android HOT 2
- MainApplication.kt:27:58 Type mismatch: inferred type is String but Boolean was expected HOT 1
- Not working on ReactNative 0.73 HOT 1
- Error retrieving namespace value from .env file during build process
- hey, did you find a way to make it work?
- Update the documentation HOT 3
- Issue with kotlin DSL
- ios undefined problem HOT 5
- [Question] - Is this lib abandoned?
- Compatibility of react-native-config with React Native 0.73+ HOT 1
- Visionos podspec misconfiguration resulting in build failure HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-config.