Giter VIP home page Giter VIP logo

Comments (31)

DonBrowny avatar DonBrowny commented on August 10, 2024 5

I having the same in my app.
Xcode Version: 15
react-native: 0.72.5

from react-native-config.

cal-overflow avatar cal-overflow commented on August 10, 2024 3

Facing the same issue with RN 0.72.5. Though the console.log(Config) results in {}`.

from react-native-config.

kiwioz avatar kiwioz commented on August 10, 2024 3

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.

gimi-anders avatar gimi-anders commented on August 10, 2024 2

Has anyone got this library working on RN 0.71 or 0.72?

from react-native-config.

gimi-anders avatar gimi-anders commented on August 10, 2024 1

@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.

rithikronald avatar rithikronald commented on August 10, 2024 1

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.

kulak91 avatar kulak91 commented on August 10, 2024

Anticipating you are using expo. Launch it with EXPO_NO_DOTENV=1

from react-native-config.

gimi-anders avatar gimi-anders commented on August 10, 2024

Anticipating you are using expo. Launch it with EXPO_NO_DOTENV=1

@kulak91 No, I am not using expo.

from react-native-config.

zabojad avatar zabojad commented on August 10, 2024

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.

RamanSB avatar RamanSB commented on August 10, 2024

Same issue I'm running it with Expo & @kulak91 suggestion did not work.

from react-native-config.

vanenshi avatar vanenshi commented on August 10, 2024

the same problem is happening in the android

from react-native-config.

Sahil6458 avatar Sahil6458 commented on August 10, 2024

#541 (comment)

from react-native-config.

vanenshi avatar vanenshi commented on August 10, 2024

#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.

vanenshi avatar vanenshi commented on August 10, 2024

@gimi-anders can you please tell us your OS and xcode version?

from react-native-config.

vanenshi avatar vanenshi commented on August 10, 2024

@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.

tuanduc2904 avatar tuanduc2904 commented on August 10, 2024

the same problem is happening in the android. NativeModules.ReactNativeConfigModule it's null

from react-native-config.

jeremy303 avatar jeremy303 commented on August 10, 2024

+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.

esenbi avatar esenbi commented on August 10, 2024

had same problem, turns out i missed this step in config https://github.com/luggit/react-native-config#app-extensions

from react-native-config.

waseemawan avatar waseemawan commented on August 10, 2024

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.

DonBrowny avatar DonBrowny commented on August 10, 2024

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.

gimi-anders avatar gimi-anders commented on August 10, 2024

@vanenshi Any progress on this?

from react-native-config.

vanenshi avatar vanenshi commented on August 10, 2024

@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.

DonBrowny avatar DonBrowny commented on August 10, 2024

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.

gimi-anders avatar gimi-anders commented on August 10, 2024

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.

gimi-anders avatar gimi-anders commented on August 10, 2024

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.

PortugalNeto avatar PortugalNeto commented on August 10, 2024

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.

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.

luizeduul avatar luizeduul commented on August 10, 2024

The same here

from react-native-config.

Roasted-Peanut avatar Roasted-Peanut commented on August 10, 2024

i had the same problem, can someone help me.
#792

from react-native-config.

maharjanrajans avatar maharjanrajans commented on August 10, 2024

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.

Roasted-Peanut avatar Roasted-Peanut commented on August 10, 2024
Screenshot 2024-03-08 at 17 47 32

Đ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.

hieulamblackbird avatar hieulamblackbird commented on August 10, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.