Yes
Yes
Environment:
OS: macOS Sierra 10.12.6
Node: 8.6.0
Yarn: 1.1.0
npm: 5.3.0
Watchman: 4.9.0
Xcode: Xcode 9.0
Packages: (installed)
react: ^16.0.0-beta.5 (I also tried with 16.0.0, It didn't work)
react-native: ^0.49.3
Target Platform: iOS (11.0)
I'm trying to integrate RN in my existing iOS Application (which does not have any other dependencies, You can think it as an empty swift project ). I am following official guide
./ios directory & Copied swift project in it.Podfile in ./ios directory with pos initPodfile,# Uncomment the next line to define a global platform for your project
platform :ios, '11.0'
target 'sample-ios-app' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'React', :path => '../node_modules/react-native', :subspecs => [
'Core',
'jschelpers',
'cxxreact',
'CxxBridge', # Include this for RN >= 0.47
'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
'RCTText',
'RCTImage',
'RCTNetwork',
'RCTActionSheet',
'RCTAnimation',
'RCTWebSocket', # needed for debugging
# Add any other subspecs you want to use in your project
]
# To use CocoaPods with React Native, you need to add this specific Yoga spec as well
pod "yoga", :path => "../node_modules/react-native/ReactCommon/yoga"
# Third party deps
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
pod 'GLog', :podspec => '../node_modules/react-native/third-party-podspecs/GLog.podspec'
end
Here is my Package.json file,
{
"name": "SampleReactNativeApp",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start"
},
"dependencies": {
"react": "^16.0.0-beta.5",
"react-native": "^0.49.3"
}
}
Should install all dependencies normally.
Doesn't install dependencies.
Here is the log after i run pod install
âžś ios pod install
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
Fetching podspec for `Folly` from `../node_modules/react-native/third-party-podspecs/Folly.podspec`
Fetching podspec for `GLog` from `../node_modules/react-native/third-party-podspecs/GLog.podspec`
Fetching podspec for `React` from `../node_modules/react-native`
Fetching podspec for `yoga` from `../node_modules/react-native/ReactCommon/yoga`
Downloading dependencies
Installing DoubleConversion (1.1.5)
Installing Folly (2016.09.26.00)
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
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for arm-apple-darwin-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for arm-apple-darwin-gcc... /Applications/Xcode 8.3.3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch armv7 -isysroot /Applications/Xcode 8.3.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk
checking whether the C compiler works... no
/Users/pranitharekar/Library/Caches/CocoaPods/Pods/External/GLog/f09d6cdb8398b4922e87d51f5245de7e-3e4e4/missing: Unknown `--is-lightweight' option
Try `/Users/pranitharekar/Library/Caches/CocoaPods/Pods/External/GLog/f09d6cdb8398b4922e87d51f5245de7e-3e4e4/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
configure: error: in `/Users/pranitharekar/Library/Caches/CocoaPods/Pods/External/GLog/f09d6cdb8398b4922e87d51f5245de7e-3e4e4':
configure: error: C compiler cannot create executables
See `config.log' for more details

You can think it as an empty swift project with no dependencies.
Problem fixed! I had different Xcode CLI set to 8.3.3 while I was working on XCode 9.0.
@Pranit-Harekar Can you show me the detail solution? I have the same issue.
SOLVED
@FlyingNoob
⚠️ Note: For me this problem occurred because I use multiple versions of xcode for development, so I keep on hopping between different versions and I forget to change the active developer directory for the same. So if you are not using multiple xcode versions then this is NOT the solution for your problem.
First check your Xcode's active developer directory by running,
xcode-select -p
This should print the active dev directory path /Applications/Xcode.app/Contents/Developer . It may differ if you have named your xcode app differently, but ideally it should be this one. xcode-select controls the location of the developer directory used by xcrun, xcodebuild, cc and other Xcode and BSD development tools.
Anyway, if your selected xcode version is different than the one shown by this command then you should switch your active dev directory by running,
sudo xcode-select -s <path>
This sets the active developer directory to the given path, for example /Applications/Xcode.app/Contents/Developer or to whatever your path is. In conclusion, the selected xcode version's path and your active developer directory path should match. My answer is too lengthy but hope that helps.
Same issue for me and I only have one version(9.0.1) Xcode installed.
react-native init demo, then react-native start, react-native run-ios, the problem occured.
Mac OS: 10.13,
Xcode: 9.0.1,
react-native: 0.49.3
I think this issue should be reopened, @Pranit-Harekar
https://github.com/facebook/react-native/issues/14382#issuecomment-326919739
I resolved by this solution.
Problem fixed
I have multiple version of Xcode development, my naming is "Xcode X.X.app", in my case the space is responsible for this issue, I renamed to "XcodeX.X.app" then
sudo xcode-select -s /Applications/XcodeX.X.app/Contents/Developer
and run again pod install
After a long research i have fixed that by changing the xcode-select path to Xcode.app path:
sudo xcode-select --switch /Applications/Xcode.app
after that run pod install
For future visitors, make sure your Xcode is exactly located at /Applications/Xcode.app. Don't rename it to Xcode 9.4.1 or the like, exactly Xcode.
@ahmedk92 Xcode app filename needs to be formatted with no space (https://github.com/facebook/react-native/issues/16279#issuecomment-357276624)
Most helpful comment
Problem fixed
I have multiple version of Xcode development, my naming is "Xcode X.X.app", in my case the space is responsible for this issue, I renamed to "XcodeX.X.app" then
sudo xcode-select -s /Applications/XcodeX.X.app/Contents/Developerand run again
pod install