Originally I was upgrading from 25.0.0.0 to 27.0.0.0, when the iOS pod install/upgrade failed. It seems to be a problem installing the glog (0.3.4) dependency of react-native.
/bin/bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory
I created a blank app and I still get the error. It seems that the error is to do with ^M being in a script file, but this mac has nothing to do with windows computer, and I’m downloading all dependencies from scratch.
Here’s the full output of pod install with the error:
pod install
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
Pre-downloading: `ExpoKit` from `http://github.com/expo/expo.git`, tag `ios/2.5.10`
Fetching podspec for `Folly` from `../node_modules/react-native/third-party-podspecs/Folly.podspec`
Fetching podspec for `React` from `../node_modules/react-native`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
Fetching podspec for `yoga` from `../node_modules/react-native/ReactCommon/yoga`
Downloading dependencies
Installing Amplitude-iOS (3.14.1)
Installing Analytics (3.6.9)
Installing AppAuth (0.92.0)
Installing Bolts (1.9.0)
Installing Branch (0.14.12)
Installing CocoaLumberjack (3.2.1)
Installing Crashlytics (3.10.1)
Installing DoubleConversion (1.1.5)
Installing ExpoKit (2.5.10)
Installing FBAudienceNetwork (4.28.1)
Installing FBSDKCoreKit (4.33.0)
Installing FBSDKLoginKit (4.33.0)
Installing FBSDKShareKit (4.33.0)
Installing Fabric (1.7.6)
Installing Folly (2016.09.26.00)
Installing GPUImage (0.1.7)
Installing Google-Maps-iOS-Utils (2.1.0)
Installing Google-Mobile-Ads-SDK (7.22.0)
Installing GoogleAppUtilities (1.1.2)
Installing GoogleAuthUtilities (2.0.2)
Installing GoogleMaps (2.5.0)
Installing GoogleNetworkingUtilities (1.2.2)
Installing GoogleSignIn (3.0.0)
Installing GoogleSymbolUtilities (1.1.2)
Installing GoogleUtilities (1.3.2)
Installing JKBigInteger2 (0.0.5)
Installing React (0.55.2)
Installing boost-for-react-native (1.63.0)
Installing glog (0.3.4)
[!] /bin/bash -c
set -e
#!/bin/bash
set -e
PLATFORM_NAME="${PLATFORM_NAME:-iphoneos}"
CURRENT_ARCH="${CURRENT_ARCH:-armv7}"
export CC="$(xcrun -find -sdk $PLATFORM_NAME cc) -arch $CURRENT_ARCH -isysroot $(xcrun -sdk $PLATFORM_NAME --show-sdk-path)"
export CXX="$CC"
# Remove automake symlink if it exists
if [ -h "test-driver" ]; then
rm test-driver
fi
./configure --host arm-apple-darwin
# Fix build for tvOS
cat << EOF >> src/config.h
/* Add in so we have Apple Target Conditionals */
#ifdef __APPLE__
#include <TargetConditionals.h>
#include <Availability.h>
#endif
/* Special configuration for AppleTVOS */
#if TARGET_OS_TV
#undef HAVE_SYSCALL_H
#undef HAVE_SYS_SYSCALL_H
#undef OS_MACOSX
#endif
/* Special configuration for ucontext */
#undef HAVE_UCONTEXT_H
#undef PC_FROM_UCONTEXT
#if defined(__x86_64__)
#define PC_FROM_UCONTEXT uc_mcontext->__ss.__rip
#elif defined(__i386__)
#define PC_FROM_UCONTEXT uc_mcontext->__ss.__eip
#endif
EOF
/bin/bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory
Here’s my package.json:
{
"main": "node_modules/expo/AppEntry.js",
"private": true,
"dependencies": {
"exp": "^54.0.0",
"expo": "^27.0.1",
"react": "16.3.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-27.0.0.tar.gz"
}
}
Here’s the podfile
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
EXPO_CPP_HEADER_DIR = 'ExpoKit'
target 'test-project' do
pod 'ExpoKit',
:git => "http://github.com/expo/expo.git",
:tag => "ios/2.5.10",
:subspecs => [
"Core",
"CPP",
"GL"
],
:inhibit_warnings => true
pod 'React',
:path => "../node_modules/react-native",
:inhibit_warnings => true,
:subspecs => [
"Core",
"ART",
"RCTActionSheet",
"RCTAnimation",
"RCTCameraRoll",
"RCTGeolocation",
"RCTImage",
"RCTNetwork",
"RCTText",
"RCTVibration",
"RCTWebSocket",
"DevSupport",
"CxxBridge"
]
pod 'yoga',
:path => "../node_modules/react-native/ReactCommon/yoga",
:inhibit_warnings => true
pod 'DoubleConversion',
:podspec => "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec",
:inhibit_warnings => true
pod 'Folly',
:podspec => "../node_modules/react-native/third-party-podspecs/Folly.podspec",
:inhibit_warnings => true
pod 'glog',
:podspec => "../node_modules/react-native/third-party-podspecs/glog.podspec",
:inhibit_warnings => true
post_install do |installer|
installer.pods_project.main_group.tab_width = '2';
installer.pods_project.main_group.indent_width = '2';
installer.pod_targets.each do |target|
if target.pod_name == 'ExpoKit'
target.native_target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'EX_DETACHED=1'
# needed for GoogleMaps 2.x
config.build_settings['FRAMEWORK_SEARCH_PATHS'] ||= []
config.build_settings['FRAMEWORK_SEARCH_PATHS'] << '${PODS_ROOT}/GoogleMaps/Base/Frameworks'
config.build_settings['FRAMEWORK_SEARCH_PATHS'] << '${PODS_ROOT}/GoogleMaps/Maps/Frameworks'
end
end
if ['Amplitude-iOS','Analytics','AppAuth','Branch','CocoaLumberjack','FBSDKCoreKit','FBSDKLoginKit','FBSDKShareKit','GPUImage','JKBigInteger2'].include? target.pod_name
target.native_target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
end
end
# Can't specify this in the React podspec because we need
# to use those podspecs for detached projects which don't reference ExponentCPP.
if target.pod_name.start_with?('React')
target.native_target.build_configurations.each do |config|
config.build_settings['HEADER_SEARCH_PATHS'] ||= ['$(inherited)']
config.build_settings['HEADER_SEARCH_PATHS'] << "${PODS_ROOT}/Headers/Public/#{EXPO_CPP_HEADER_DIR}"
end
end
# Build React Native with RCT_DEV enabled
next unless target.pod_name == 'React'
target.native_target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'RCT_DEV=1'
end
end
end
end
Things I have tried:
- Creating a blank App - Same Error
- Reverting to 26.0.0 - Same Error
- Doing a dos2unix on the react-native/scripts/*.sh folder - Same Error
- Removing and recreating node_modules with npm
- Removing and recreating node_modules with yarn
I’m dead in the water here. Any suggestions or help would be deeply appreciated!
Full zip of the test project for your enjoyment here : Dropbox - test-project.zip - Simplify your life