Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with v0.12.0 + React Native 0.61.4 #412

Open
c0d3x opened this issue Nov 22, 2019 · 18 comments
Open

Problems with v0.12.0 + React Native 0.61.4 #412

c0d3x opened this issue Nov 22, 2019 · 18 comments

Comments

@c0d3x
Copy link

c0d3x commented Nov 22, 2019

Is there a migration guide from 0.11.7 to 0.12.0?
What do I need to remove from the old config, and what do I need to add to the new config?
Do I need this config in the Podfile?

    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.rb"

      target.build_phases << phase
      target.build_phases.move(phase,0)
    end

I have added a config file in ios folder called Config.xcconfig with this line:
#include? "tmp.xcconfig"

I get some build errors, when I try to upgrade from 0.11.7 to 0.12.0.

I have the following:
echo ".env.test" > /tmp/envfile
Added this line to it as the guide suggests:
image

I get this build error:
/node_modules/react-native-config/ios/ReactNativeConfig/ReadDotEnv.rb:27:in join': no implicit conversion of nil into String (TypeError) from /node_modules/react-native-config/ios/ReactNativeConfig/ReadDotEnv.rb:27:in read_dot_env'
from ./node_modules/react-native-config//ios/ReactNativeConfig/BuildDotenvConfig.rb:15:in `

'
reading env file from and writing .m to
going to read env file from root folder

@tgearig
Copy link

tgearig commented Nov 25, 2019

I have the same issue, and haven't been able to find a workaround.

@c0d3x
Copy link
Author

c0d3x commented Nov 25, 2019

Updates:
Removed the source script from the pre-actions on each env, and added it to a build phase:
image

Removed the config from Podfile

@c0d3x
Copy link
Author

c0d3x commented Nov 25, 2019

Now I cannot access env from Config object in iOS from React, works fine in Android though.

@jishuke
Copy link

jishuke commented Nov 27, 2019

I have the same issue, and haven't been able to find a workaround.

@phuoc-insignia
Copy link

+1

@el-lsan
Copy link

el-lsan commented Nov 29, 2019

facing same issue.

@blackbing
Copy link

+1

@timkomip
Copy link

timkomip commented Dec 2, 2019

Not sure if this helps but...

We just upgraded to the latest and had to remove plist preprocessing (this is in Build Settings).

INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional";
INFOPLIST_PREFIX_HEADER = "${BUILD_DIR}/GeneratedInfoPlistDotEnv.h";
INFOPLIST_PREPROCESS = YES

Also, we did not need to modify the Podfile with the script @c0d3x posted above.

@jitendralakhmani-proptiger

Any update on this?

@hydraZty
Copy link

same issue

1 similar comment
@hiepnm
Copy link

hiepnm commented Dec 19, 2019

same issue

@sazanow
Copy link

sazanow commented Dec 20, 2019

same here

@shawnhong1
Copy link

Same issue

@zuhair-naqvi
Copy link

any updates?

@lisichka999
Copy link

Same here

@bradenpowers
Copy link

Seeing the same issue as well. We have rolled back to 0.11.7

@twelve17
Copy link

twelve17 commented Jan 23, 2020

I don't know if this will help, but I got some clarification to my comment here (see the comments that follow it as well). It is working for me, using v0.12.0 + RN 0.61.5.

@maxkomarychev
Copy link
Contributor

hey 👋 I kindly ask to try my lib https://www.npmjs.com/package/react-native-ultimate-config if the issue persists. it works well for me in rn60+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests