lugg / react-native-config

Bring some 12 factor love to your mobile apps!
MIT License
4.82k stars 657 forks source link

react-native 0.60 Preprocessing failure #357

Open bramski opened 5 years ago

bramski commented 5 years ago

Screen Shot 2019-07-04 at 9 17 52 AM

roshangm1 commented 5 years ago

Add this post install script in the Podfile (at the end)

post_install do |installer|
    installer.pods_project.targets.each do |target|
      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

and do pod install.

Now try to build.

jake41 commented 5 years ago

@roshangm1 Do you know how to read env values in info.plist ? Which npm version of react-native-config are you using.

tgensol commented 5 years ago

@roshangm1 Your fix works well for "building" but it doesn't work when I am doing "archive". Any idea ?

yvocilon commented 5 years ago

@roshangm1 I experience the same as @tgensol, do you have any fix for archiving?

tgensol commented 5 years ago

Actually I was not using the GeneratedInfoPlist file and feature from react-native-config, so I simply removed it in my build settings, and it is working just fine now. (By the way, I cannot find in the Readme the setup part for the GeneratedInfoPlist, so it was maybe an old feature that does not exist anymore ? )

Eryndor commented 5 years ago

Any progress on this? 😄

yvocilon commented 5 years ago

I also removed my GeneratedInfoPlist file from my build settings because I did not need it. This seems like the only fix right now

kuzyakiev commented 5 years ago

Any progress on this? [2] 😄

HelloCore commented 5 years ago

I modified script a little bit.

post_install do |installer|
    installer.pods_project.targets.each do |target|
      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"\
                             " && ruby $RNC_ROOT/ios/ReactNativeConfig/BuildDotenvConfig.ruby"

        target.build_phases << phase
        target.build_phases.move(phase,0)
      end
    end
  end
JBaczuk commented 5 years ago

Custom pod install script? 🤔 Do I really need a .env in my mobile app?

vforvasile commented 4 years ago

any good forks that solve this issue?