Hi all,
I updated from Xcode 10.1 to Xcode 10.2 and got this error when building now
error: unable to spawn process (Exec format error)
I've got a little build script executed during build that basically runs BuildDotenvConfig.ruby inside react-native-config/ios/ReactNativeConfig, to build the dotenv files.
The error happens when this script is executing.
This is the script that runs during build:
#/bin/sh
RNCDIR="./node_modules/react-native-config/ios"
if [ ! -z "$SYMROOT" ]; then
# Ensure directories exist before copying files
mkdir -p $SYMROOT
mkdir -p $BUILD_DIR
# Build dotenv
cd $RNCDIR
./ReactNativeConfig/BuildDotenvConfig.ruby
cd -
# Copy generated dotenv files to node_modules directory
cp "$BUILD_DIR/GeneratedInfoPlistDotEnv.h" "$RNCDIR/ReactNativeConfig/GeneratedInfoPlistDotEnv.h"
cp "$SYMROOT/GeneratedDotEnv.m" "$RNCDIR/ReactNativeConfig/GeneratedDotEnv.m"
fi
Does somebody know what this might be?
I currently downgraded my Xcode version to 10.1 to fix this.
Hello everyone, I also have the same problem as @bnolens after upgrade Xcode to 10.2.
The solution from @bnolens worked for me too.
But I doubt it would be how Xcode 10.2 interpret shell script to run on Mac OS.
So if anyone who know how to change shell script follow to the right format, I am thank you in advance.
(I'm sorry if I am misunderstanding this bug)
My Environment are
and I using cocoa-pod to build IOS applications.
Guys, just change the first line of scripts/build-env.sh from #/bin/sh to #!/bin/sh
Changing the first line to #!/bin/sh fixed it for me. Thanks @stephenkopylov! 馃嵑
That's was fixed for me too. thank you @stephenkopylov 馃憤
@stephenkopylov I love you man. I'm just curious. How do you know this stuff? What was the clue?
Where do you add the scripts/build-env.sh file ? The readme doesn't talk about it
@raphaelbadia Maybe https://github.com/luggit/react-native-config/issues/187#issuecomment-353156419?
Most helpful comment
Guys, just change the first line of scripts/build-env.sh from
#/bin/shto#!/bin/sh