I have a react native named MyApp and it is two app sides managed in single codebase.The app is managed by react native config during its build the config is set to that specific environment like env1 or env2.For Creating the build i run the script npm run ios:env1 and npm run ios:env2 and it sets the enviroment first and then the apps build is generated and also the apps routes are setted according to that setted config environment.so it works fine for this part.
But now when i put the apps to testflight i need to create their respective archive builds but i am not getting how to do that as before the archive build i need to set the environment like env1 or env2. I read the documentation of react native config also from below it told to create schemes n all for each environment also did that but still i get error the error is **"Command PhaseScriptExecution failed with a nonzero exit code" ** which from react native config. Also you can check the below image for more reference. My .env.env1 file is stored in .env folder in root direcotry of my project
I have also added a script inside the scheme in Pre-actions in Build please refer below image for the script is wrote in the tareget in schemes
Also Below is the link for the react native config documentation which i followed. react-native-config documentation
The Errors is get
Note: "myapp-reactnative" is my main root directory
*HOST_PATH=/Users/me/Desktop/myapp/myapp-reactnative/ios/Pods/../..
- /Users/me/Desktop/myapp/myapp-reactnative/ios/Pods/../../node_modules/react-native-config/ios/ReactNativeConfig/BuildDotenvConfig.rb /Users/me/Desktop/myapp/myapp-reactnative/ios/Pods/../.. /Users/me/Desktop/myapp/myapp-reactnative/ios/Pods/../../node_modules/react-native-config/ios/ReactNativeConfig /Users/me/Desktop/myapp/myapp-reactnative/node_modules/react-native-config/ios/ReactNativeConfig/ReadDotEnv.rb:29:in
read': Is a directory @ io_fread - /Users/me/Desktop/myapp/myapp-reactnative/.env (Errno::EISDIR) from /Users/me/Desktop/myapp/myapp-reactnative/node_modules/react-native-config/ios/ReactNativeConfig/ReadDotEnv.rb:29:inread_dot_env' from /Users/me/Desktop/myapp/myapp-reactnative/ios/Pods/../../node_modules/react-native-config/ios/ReactNativeConfig/BuildDotenvConfig.rb:15:in `' reading env file from /Users/me/Desktop/myapp/myapp-reactnative/ios/Pods/../.. and writing .m to /Users/me/Desktop/myapp/myapp-reactnative/ios/Pods/../../node_modules/react-native-config/ios/ReactNativeConfig going to read env file from root folder /Users/me/Desktop/myapp/myapp-reactnative/ios/Pods/../.. Command PhaseScriptExecution failed with a nonzero exit code*
So does anyone have any solution for this how to do it.