Skip to content

[0.49.3] Pod install doesn't install all dependencies, fails to install GLog #16279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Pranit-Harekar opened this issue Oct 10, 2017 · 9 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@Pranit-Harekar
Copy link

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

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)

Steps to Reproduce

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

  1. I created ./ios directory & Copied swift project in it.
  2. Created Podfile in ./ios directory with pos init
  3. Here is my Podfile,
# 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"
    }
}

Expected Behavior

Should install all dependencies normally.

Actual Behavior

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

screen shot 2017-10-10 at 2 56 51 pm

Reproducible Demo

You can think it as an empty swift project with no dependencies.

@Pranit-Harekar Pranit-Harekar changed the title Pod install doesn't install all dependencies [fails to install GLog] [0.49.3] Pod install doesn't install all dependencies, fails to install GLog Oct 10, 2017
@Pranit-Harekar
Copy link
Author

Problem fixed! I had different Xcode CLI set to 8.3.3 while I was working on XCode 9.0.

@Arvin-J
Copy link

Arvin-J commented Oct 20, 2017

@Pranit-Harekar Can you show me the detail solution? I have the same issue.

@Pranit-Harekar
Copy link
Author

Pranit-Harekar commented Oct 23, 2017

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.

@silentcloud
Copy link

silentcloud commented Oct 24, 2017

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

@silentcloud
Copy link

#14382 (comment)

I resolved by this solution.

@elneruda
Copy link

elneruda commented Jan 12, 2018

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

@areeb111
Copy link

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

@ahmedk92
Copy link

ahmedk92 commented Sep 2, 2018

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.

@elneruda
Copy link

elneruda commented Sep 2, 2018

@ahmedk92 Xcode app filename needs to be formatted with no space (#16279 (comment))

@facebook facebook locked as resolved and limited conversation to collaborators Oct 10, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

7 participants