Open bneigher opened 5 years ago
I'm also having trouble upgrading because of this module. Manually linking didn't solve it for me either.
@bsonntag The manual link was not working here also, but after a cd android && ./gradlew clean, the command react-native run-android works again.
@marceloch2 I have no issues with Android, it's only the iOS build that is failing.
Update on my keyboard mashing.
I ended up using react-native init and then manually adding the dependencies into my app and the react-native-config issue disappeared. I think this problem is related to stale references to linked dependencies and the root issue is not specific to react-native-config.
While it was time consuming to do brain surgery from my old to new react native project - I think for the 0.5x to 0.6x transition may be a big enough change to do it this way.
I had the same issue, but got it solved by removing the preprocessing step like it's described in the diff of this readme change: https://github.com/luggit/react-native-config/commit/1eb6ac01991210ddad2989857359a0f6ee35d734
Are there any plans to release a new version on npm with that bugfix ?
@GertjanReynaert thanks that was the issue, just to add that you need the github master in your package.json not the npm version
I had the same issue, mine is a bit weird. It works on debug mode but not release mode (Android).
package.json
"react-native": "0.60.4",
"react-native-config": "^0.11.7"
Im using auto-linking. when I ran ENVFILE=.env.prod react-native run-android --variant=release
. It did shows "Reading env from: .env.prod"
So weird!!
react-native link react-native-config
then update Pod for iOS, Gradle Sync for android. It worked for me!
Happens exactly the same to me. Did you find a solution, @edwinwong90?
Guys! is there any update for that?
Update IT STARTED WORKING
"react-native": "0.61.5", "react-native-config": "^0.12.0"
After spending so much time trying to setup Autolink, I said "fuck it"
react-native link react-native-config
Note: This one is gonna modify your Podfile, so you should run cd ios && pod install
build.gradle
file the same way as explained here I had the same issue, but got it solved by removing the preprocessing step like it's described in the diff of this readme change: 1eb6ac0
GOD... This saved me! I was stuck on this for days! Thank you for showing me how dumb I can be :)
I had the same issue, but got it solved by removing the preprocessing step like it's described in the diff of this readme change: 1eb6ac0
i feel blind and stupid. can anyone link to the code changes in the diff that refer to the preprocessing step?
In my case, I was getting the same error on a semi-fresh react-native project when compiling on an Apple M1 chip.
I was able to "resolve" this by excluding the arm64
arch in my podfile. I see this as a workaround, as I don't have a good understanding of why it's failing on the Apple M1:
target 'MyProject' do
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
use_flipper!({ 'Flipper-Folly' => '2.3.0' })
post_install do |installer|
flipper_post_install(installer)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
config.build_settings['EXCLUDED_ARCHS'] = 'arm64'
config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
end
end
end
end
I'm not sure if this is the correct approach but it seems to have solved the "ld: library not found for -lReactNativeConfig" error and I can use the library without problems now.
It's been a slow and tedious effort for the react native update, seems that there is a roadblock with the ios pod setup.
package.json
Podfile
Build Path Headers:
Error:
Tried to manually react-native link, no dice. Is anyone else seeing this?