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
{
...
"react-native": "^0.60.3",
"react-native-config": "^0.11.7",
...
}
Podfile
target 'MyApp' do
...
pod 'react-native-config', :path => '../node_modules/react-native-config'
...
end
post_install do |installer|
installer.pods_project.targets.each do |target|
targets_to_ignore = %w(React)
if targets_to_ignore.include? target.name
target.remove_from_project
end
if target.name == 'react-native-config'
phase = target.project.new(Xcodeproj::Project::Object::PBXShellScriptBuildPhase)
phase.shell_script = "cd ../../"\
" && RNC_ROOT=./node_modules/react-native-config/"\
" && export SYMROOT=$RNC_ROOT/ios/ReactNativeConfig"\
" && export BUILD_DIR=$RNC_ROOT/ios/ReactNativeConfig"\
" && ruby $RNC_ROOT/ios/ReactNativeConfig/BuildDotenvConfig.ruby"
target.build_phases << phase
target.build_phases.move(phase,0)
end
end
end
Build Path Headers:
Error:
ld: library not found for -lReactNativeConfig
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Tried to manually react-native link, no dice.
Is anyone else seeing this?
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-configcd 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 :)
Most helpful comment
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