joeferraro / joeferraro/react-native-env

React native packager script fails: Unsupported value of $CONFIGURATION=...

Open
#8 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Objective-C
Stars
50
Forks
12
PR merge metrics
No merged PRs in 30d

Description

I worked around the issue but it might be good to document it somewhere. When using the separate environment build instructions linked here, the resulting build config is incompatible with react-native's packager script, since that script expects the $CONFIGURATION to equal one of Debug or Release, but the $CONFIGURATION will be DEV, PROD or SYS if you follow the instructions there.

To fix it, I'm massaging the $CONFIGURATION value in the **Bundle React Native code and images** build phase of my app, before the packager script is executed. I changed the contents of the script to be:

```
// Rewrite the value of configuration to what react-native script expects.
case "$CONFIGURATION" in
DEV)
CONFIGURATION=Debug
;;
PROD)
CONFIGURATION=Release
;;
Release)
;;
*)
CONFIGURATION=Debug
;;
esac

// Now the packager script can be executed normally.
../node_modules/react-native/packager/react-native-xcode.sh
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.