facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118.61k stars 24.28k forks source link

Pod install fails on new project init - fails at installing flipper-glog #32291

Closed roncodes closed 3 years ago

roncodes commented 3 years ago

Description

Suddenly unable to complete pod install when starting a new react-native project. Pod install also fails on current existing projects. I have tried the suggested solution of running sudo xcode-select --switch /Applications/Xcode.app to no avail. I've tried several suggestions but still stuck.

Previously everything was installing working fine. I left my computer for about an hour, came back and pod install fails everytime with glog. Tried restart twice.

React Native version:

System:
    OS: macOS 11.3
    CPU: (8) x64 Apple M1
    Memory: 22.41 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.16.1 - /usr/local/bin/node
    Yarn: 1.22.10 - ~/.nvm/versions/node/v15.9.0/bin/yarn
    npm: 6.14.12 - /usr/local/bin/npm
    Watchman: 4.9.0 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.2 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 15.0, DriverKit 20.4, macOS 11.3, tvOS 15.0, watchOS 8.0
    Android SDK:
      API Levels: 28, 29, 30
      Build Tools: 28.0.3, 29.0.2, 30.0.3, 31.0.0
      System Images: android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom_64, android-29 | Google Play Intel x86 Atom_64, android-30 | Google APIs Intel x86 Atom, android-30 | Google APIs Intel x86 Atom_64, android-30 | Google Play Intel x86 Atom, android-30 | Google Play Intel x86 Atom_64
      Android NDK: Not Found
  IDEs:
    Android Studio: 4.1 AI-201.8743.12.41.7199119
    Xcode: 13.0/13A233 - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_292 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: Not Found
    react-native: Not Found
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

Run

npx react-native init TestApp

Received

✔ Downloading template
✔ Copying template
✔ Processing template
✖ Installing CocoaPods dependencies (this may take a few minutes)
✖ Installing CocoaPods dependencies (this may take a few minutes)
error Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template.
Please try again manually: "cd ./TestApp/ios && pod install".
CocoaPods documentation: https://cocoapods.org/

Next went into project and ran

npx pod-install

Error occurs when installing Flipper-Glog

npx: installed 1 in 1.743s
Scanning for pods...
1.11.2
> pod install
Auto-linking React Native modules for target `StorefrontApp`: RNCAsyncStorage, RNCMaskedView, RNCPicker, RNCPushNotificationIOS, RNDeviceInfo, RNGestureHandler, RNPermissions, RNReanimated, RNSVG, RNScreens, react-native-config, react-native-geolocation-service, react-native-maps, react-native-mmkv-storage, react-native-safe-area-context, and stripe-react-native
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
Downloading dependencies
Installing CocoaAsyncSocket (7.6.5)
Installing DoubleConversion (1.1.6)
Installing FBLazyVector (0.64.2)
Installing FBReactNativeSpec (0.64.2)
Installing Flipper (0.75.1)
Installing Flipper-DoubleConversion (1.1.7)
Installing Flipper-Folly (2.5.3)
Installing Flipper-Glog (0.3.6)
[!] /bin/bash -c 
set -e
#!/bin/bash
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

set -e

PLATFORM_NAME="${PLATFORM_NAME:-iphoneos}"
CURRENT_ARCH="${CURRENT_ARCH}"

if [ -z "$CURRENT_ARCH" ] || [ "$CURRENT_ARCH" == "undefined_arch" ]; then
    # Xcode 10 beta sets CURRENT_ARCH to "undefined_arch", this leads to incorrect linker arg.
    # it's better to rely on platform name as fallback because architecture differs between simulator and device

    if [[ "$PLATFORM_NAME" == *"simulator"* ]]; then
        CURRENT_ARCH="x86_64"
    else
        CURRENT_ARCH="armv7"
    fi
fi

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

# Prepare exported header include
EXPORTED_INCLUDE_DIR="exported/glog"
mkdir -p exported/glog
cp -f src/glog/log_severity.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/logging.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/raw_logging.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/stl_logging.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/vlog_is_on.h "$EXPORTED_INCLUDE_DIR/"

checking for a BSD-compatible install... /usr/bin/install -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... ./install-sh -c -d
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.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk
checking whether the C compiler works... no
/Users/ron/Library/Caches/CocoaPods/Pods/Release/Flipper-Glog/0.3.6-1dfd6/missing: Unknown `--is-lightweight' option
Try `/Users/ron/Library/Caches/CocoaPods/Pods/Release/Flipper-Glog/0.3.6-1dfd6/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
configure: error: in `/Users/ron/Library/Caches/CocoaPods/Pods/Release/Flipper-Glog/0.3.6-1dfd6':
configure: error: C compiler cannot create executables
See `config.log' for more details

Aborting run
An unexpected error was encountered. Please report it as a bug:
CocoaPodsError: Command `pod install` failed.
└─ Cause: pod exited with non-zero code: 1
    at CocoaPodsPackageManager._installAsync (/Users/ron/.npm/_npx/15846/lib/node_modules/pod-install/build/index.js:2:92213)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async CocoaPodsPackageManager.installAsync (/Users/ron/.npm/_npx/15846/lib/node_modules/pod-install/build/index.js:2:90176)
    at async runAsync (/Users/ron/.npm/_npx/15846/lib/node_modules/pod-install/build/index.js:2:106198)
    at async /Users/ron/.npm/_npx/15846/lib/node_modules/pod-install/build/index.js:2:106284 {
  code: 'COMMAND_FAILED',
  cause: Error: pod exited with non-zero code: 1
      at ChildProcess.h (/Users/ron/.npm/_npx/15846/lib/node_modules/pod-install/build/index.js:2:1073)
      at Object.onceWrapper (events.js:422:26)
      at ChildProcess.emit (events.js:315:20)
      at maybeClose (internal/child_process.js:1048:16)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
      ...
      at Object.spawnAsync [as default] (/Users/ron/.npm/_npx/15846/lib/node_modules/pod-install/build/index.js:2:558)
      at CocoaPodsPackageManager._runAsync (/Users/ron/.npm/_npx/15846/lib/node_modules/pod-install/build/index.js:2:92995)
      at CocoaPodsPackageManager._installAsync (/Users/ron/.npm/_npx/15846/lib/node_modules/pod-install/build/index.js:2:90499)
      at CocoaPodsPackageManager.installAsync (/Users/ron/.npm/_npx/15846/lib/node_modules/pod-install/build/index.js:2:90187)
      at runAsync (/Users/ron/.npm/_npx/15846/lib/node_modules/pod-install/build/index.js:2:106206)
      at processTicksAndRejections (internal/process/task_queues.js:93:5)
      at async /Users/ron/.npm/_npx/15846/lib/node_modules/pod-install/build/index.js:2:106284 {
    pid: 15860,
    output: [ '', '' ],
    stdout: '',
    stderr: '',
    status: 1,
    signal: null
  },
  isPackageManagerError: true
}

Opening the config.log displays

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by glog configure 0.3.5, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ./configure --host arm-apple-darwin

## --------- ##
## Platform. ##
## --------- ##

hostname = Ronalds-MacBook-Pro-2.local
uname -m = x86_64
uname -r = 20.4.0
uname -s = Darwin
uname -v = Darwin Kernel Version 20.4.0: Fri Mar  5 01:14:02 PST 2021; root:xnu-7195.101.1~3/RELEASE_ARM64_T8101

/usr/bin/uname -p = i386
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = Mach kernel version:
     Darwin Kernel Version 20.4.0: Fri Mar  5 01:14:02 PST 2021; root:xnu-7195.101.1~3/RELEASE_ARM64_T8101
Kernel configured for up to 8 processors.
8 processors are physically available.
8 processors are logically available.
Processor type: i486 (Intel 80486)
Processors active: 0 1 2 3 4 5 6 7
Primary memory available: 16.00 gigabytes
Default processor set: 513 tasks, 3000 threads, 8 processors
Load average: 18.31, Mach factor: 0.44
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /Users/ron/.npm/_npx/8931/bin
PATH: /Users/ron/Development/fleetbase/storefront-app/node_modules/.bin
PATH: /usr/local/bin
PATH: /usr/local/opt/llvm/bin
PATH: /opt/homebrew/bin
PATH: /Users/ron/.nvm/versions/node/v15.9.0/bin
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin
PATH: /Library/Apple/usr/bin
PATH: /Users/ron/.cargo/bin
PATH: /Users/ron/Library/Android/sdk/emulator
PATH: /Users/ron/Library/Android/sdk/tools
PATH: /Users/ron/Library/Android/sdk/tools/bin
PATH: /Users/ron/Library/Android/sdk/platform-tools

## ----------- ##
## Core tests. ##
## ----------- ##

configure:2788: checking for a BSD-compatible install
configure:2856: result: /usr/bin/install -c
configure:2867: checking whether build environment is sane
configure:2922: result: yes
configure:2960: WARNING: 'missing' script is too old or missing
configure:2981: checking for arm-apple-darwin-strip
configure:3011: result: no
configure:3021: checking for strip
configure:3037: found /usr/bin/strip
configure:3048: result: strip
configure:3073: checking for a thread-safe mkdir -p
configure:3112: result: ./install-sh -c -d
configure:3119: checking for gawk
configure:3149: result: no
configure:3119: checking for mawk
configure:3149: result: no
configure:3119: checking for nawk
configure:3149: result: no
configure:3119: checking for awk
configure:3135: found /usr/bin/awk
configure:3146: result: awk
configure:3157: checking whether make sets $(MAKE)
configure:3179: result: yes
configure:3208: checking whether make supports nested variables
configure:3225: result: yes
configure:3369: checking for arm-apple-darwin-gcc
configure:3396: result: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk
configure:3665: checking for C compiler version
configure:3674: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk --version >&5
Apple clang version 13.0.0 (clang-1300.0.29.3)
Target: armv7-apple-darwin20.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
configure:3685: $? = 0
configure:3674: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk -v >&5
Apple clang version 13.0.0 (clang-1300.0.29.3)
Target: armv7-apple-darwin20.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
clang: warning: argument unused during compilation: '-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk' [-Wunused-command-line-argument]
configure:3685: $? = 0
configure:3674: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk -V >&5
clang: error: argument to '-V' is missing (expected 1 value)
clang: error: no input files
configure:3685: $? = 1
configure:3674: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk -qversion >&5
clang: error: unknown argument '-qversion'; did you mean '--version'?
clang: error: no input files
configure:3685: $? = 1
configure:3705: checking whether the C compiler works
configure:3727: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk  -I/usr/local/opt/llvm/include -L/usr/local/opt/llvm/lib conftest.c  >&5
ld: in '/usr/local/opt/llvm/lib/libunwind.dylib', xcode-select -p
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:3731: $? = 1
configure:3769: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "glog"
| #define PACKAGE_TARNAME "glog"
| #define PACKAGE_VERSION "0.3.5"
| #define PACKAGE_STRING "glog 0.3.5"
| #define PACKAGE_BUGREPORT "opensource@google.com"
| #define PACKAGE_URL ""
| #define PACKAGE "glog"
| #define VERSION "0.3.5"
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3774: error: in `/Users/ron/Library/Caches/CocoaPods/Pods/Release/Flipper-Glog/0.3.6-1dfd6':
configure:3776: error: C compiler cannot create executables
See `config.log' for more details

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=set
ac_cv_env_CC_value='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk'
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=set
ac_cv_env_CPPFLAGS_value=-I/usr/local/opt/llvm/include
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXCPP_set=
ac_cv_env_CXXCPP_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=set
ac_cv_env_CXX_value='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk'
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value=-L/usr/local/opt/llvm/lib
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=set
ac_cv_env_host_alias_value=arm-apple-darwin
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_AWK=awk
ac_cv_prog_CC='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk'
ac_cv_prog_ac_ct_STRIP=strip
ac_cv_prog_make_make_set=yes
am_cv_make_support_nested_variables=yes

## ----------------- ##
## Output variables. ##
## ----------------- ##

ACLOCAL='aclocal-1.14'
AMDEPBACKSLASH=''
AMDEP_FALSE=''
AMDEP_TRUE=''
AMTAR='$${TAR-tar}'
AM_BACKSLASH='\'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
AM_DEFAULT_VERBOSITY='1'
AM_V='$(V)'
AR=''
AUTOCONF='autoconf'
AUTOHEADER='autoheader'
AUTOMAKE='automake-1.14'
AWK='awk'
CC='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk'
CCDEPMODE=''
CFLAGS=''
CPP=''
CPPFLAGS='-I/usr/local/opt/llvm/include'
CXX='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk'
CXXCPP=''
CXXDEPMODE=''
CXXFLAGS=''
CYGPATH_W='echo'
DEFS=''
DEPDIR=''
DISABLE_RTTI_FALSE=''
DISABLE_RTTI_TRUE=''
DLLTOOL=''
DSYMUTIL=''
DUMPBIN=''
ECHO_C='\c'
ECHO_N=''
ECHO_T=''
EGREP=''
ENABLE_FRAME_POINTERS_FALSE=''
ENABLE_FRAME_POINTERS_TRUE=''
EXEEXT=''
FGREP=''
GCC_FALSE=''
GCC_TRUE=''
GFLAGS_CFLAGS=''
GFLAGS_LIBS=''
GMOCK_CFLAGS=''
GMOCK_CONFIG=''
GMOCK_LIBS=''
GREP=''
GTEST_CFLAGS=''
GTEST_CONFIG=''
GTEST_LIBS=''
HAVE_GMOCK_FALSE=''
HAVE_GMOCK_TRUE=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
LD=''
LDFLAGS='-L/usr/local/opt/llvm/lib'
LIBOBJS=''
LIBS=''
LIBTOOL=''
LIBTOOL_DEPS=''
LIPO=''
LN_S=''
LTLIBOBJS=''
MAKEINFO='makeinfo'
MANIFEST_TOOL=''
MINGW_CFLAGS=''
MKDIR_P='./install-sh -c -d'
NM=''
NMEDIT=''
OBJDUMP=''
OBJEXT=''
OTOOL64=''
OTOOL=''
PACKAGE='glog'
PACKAGE_BUGREPORT='opensource@google.com'
PACKAGE_NAME='glog'
PACKAGE_STRING='glog 0.3.5'
PACKAGE_TARNAME='glog'
PACKAGE_URL=''
PACKAGE_VERSION='0.3.5'
PATH_SEPARATOR=':'
PTHREAD_CC=''
PTHREAD_CFLAGS=''
PTHREAD_LIBS=''
RANLIB=''
SED=''
SET_MAKE=''
SHELL='/bin/sh'
STRIP='strip'
UNWIND_LIBS=''
VERSION='0.3.5'
X86_64_FALSE=''
X86_64_TRUE=''
ac_ct_AR=''
ac_ct_CC=''
ac_ct_CXX=''
ac_ct_DUMPBIN=''
ac_cv___attribute___noinline=''
ac_cv___attribute___noreturn=''
ac_cv___attribute___printf_4_5=''
ac_cv_cxx_using_operator=''
ac_cv_have___builtin_expect=''
ac_cv_have___uint16=''
ac_cv_have_inttypes_h=''
ac_cv_have_libgflags=''
ac_cv_have_stdint_h=''
ac_cv_have_systypes_h=''
ac_cv_have_u_int16_t=''
ac_cv_have_uint16_t=''
ac_cv_have_unistd_h=''
ac_google_end_namespace=''
ac_google_namespace=''
ac_google_start_namespace=''
acx_pthread_config=''
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__fastdepCXX_FALSE=''
am__fastdepCXX_TRUE=''
am__include=''
am__isrc=''
am__leading_dot='.'
am__nodep=''
am__quote=''
am__tar='$${TAR-tar} chof - "$$tardir"'
am__untar='$${TAR-tar} xf -'
bindir='${exec_prefix}/bin'
build=''
build_alias=''
build_cpu=''
build_os=''
build_vendor=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host='arm-apple-darwin'
host_alias='arm-apple-darwin'
host_cpu=''
host_os=''
host_vendor=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${SHELL} /Users/ron/Library/Caches/CocoaPods/Pods/Release/Flipper-Glog/0.3.6-1dfd6/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
mkdir_p='$(MKDIR_P)'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "glog"
#define PACKAGE_TARNAME "glog"
#define PACKAGE_VERSION "0.3.5"
#define PACKAGE_STRING "glog 0.3.5"
#define PACKAGE_BUGREPORT "opensource@google.com"
#define PACKAGE_URL ""
#define PACKAGE "glog"
#define VERSION "0.3.5"

configure: exit 77

Expected Results

Expect new react native project to setup.

Snack, code example, screenshot, or link to a repository:

N/A

roncodes commented 3 years ago

Update below are a few things I've tried to no avail

sudo xcode-select --switch /Applications/Xcode.app
sudo xcode-select --reset
sudo xcodebuild -license accept
brew update
brew upgrade
brew info gcc
brew install gcc
brew cleanup
brew install gawk

I've disabled flipper as well, and after that the pod install still fails at glog

Additionally I'm able to build and install glog (v0.5.0) manually

roncodes commented 3 years ago

Update! getting closer: I got into node_modules/react-native/scripts/ios-configure-glog.sh where the error happens and boiled it down to this line ./configure --host arm-apple-darwin I then navigated to the glog CocoaPod directory /Library/Caches/CocoaPods/Pods/External/glog/ and run the line from there where the same error occured.

I then run the line with sudo, and it was able to configure successfully. The error seems to be an issue with finding the correct c compiler. I think the issue is with my homebrew install on m1, looks like I have homebrew installed twice in two sep directories. Just updating here so if anyone else runs into this exact issue. I am going to try reinstalling homebrew with llvm and gcc to see if this resolves the pod install issue.

fighter520 commented 3 years ago

git config --global core.autocrlf false try this, it works for me . you can find the bug issues in google/glog at github.

roncodes commented 3 years ago

@fighter520 just tried still getting the same error.

Furthermore if anyone is running into this issue. Two installs are needed on M1 for homebrew one for ARM binaries the other for intel, the ARM binary installation location should be /opt/homebrew - you can find several resources online about installing homebrew in this dir for ARM binaries.

For me I found it easier to symlink the brew binary as armbrew like such ln -sf /opt/homebrew/bin/brew /usr/local/bin/armbrew, once that was done I created a Brewfile from my main homebrew and installed it with my armbrew.

cd ~/
brew bundle dump
armbrew bundle install --file ~/Brewfile

There's a great answer on apple exchange about setting up homebrew in /opt/homebrew this answer will get you squared away https://apple.stackexchange.com/a/410829

Now when manually running ./configure --host arm-apple-darwin it runs successfully.

Although when it runs via pod install still getting the same error at

checking for a BSD-compatible install... /usr/bin/install -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... ./install-sh -c -d
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for arm-apple-darwin-gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk
checking whether the C compiler works... no
/Users/ron/Library/Caches/CocoaPods/Pods/Release/Flipper-Glog/0.3.6-1dfd6/missing: Unknown `--is-lightweight' option
Try `/Users/ron/Library/Caches/CocoaPods/Pods/Release/Flipper-Glog/0.3.6-1dfd6/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
configure: error: in `/Users/ron/Library/Caches/CocoaPods/Pods/Release/Flipper-Glog/0.3.6-1dfd6':
configure: error: C compiler cannot create executables
See `config.log' for more details
fighter520 commented 3 years ago

you can see https://github.com/react-native-community/cli/issues/1194 and https://github.com/facebook/react-native/issues/29101

@fighter520 just tried still getting the same error.

Furthermore if anyone is running into this issue. Two installs are needed on M1 for homebrew one for ARM binaries the other for intel, the ARM binary installation location should be /opt/homebrew - you can find several resources online about installing homebrew in this dir for ARM binaries.

For me I found it easier to symlink the brew binary as armbrew like such ln -sf /opt/homebrew/bin/brew /usr/local/bin/armbrew, once that was done I created a Brewfile from my main homebrew and installed it with my armbrew.

cd ~/
brew bundle dump
armbrew bundle install --file ~/Brewfile

There's a great answer on apple exchange about setting up homebrew in /opt/homebrew this answer will get you squared away https://apple.stackexchange.com/a/410829

Now when manually running ./configure --host arm-apple-darwin it runs successfully.

Although when it runs via pod install still getting the same error at

checking for a BSD-compatible install... /usr/bin/install -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... ./install-sh -c -d
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for arm-apple-darwin-gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk
checking whether the C compiler works... no
/Users/ron/Library/Caches/CocoaPods/Pods/Release/Flipper-Glog/0.3.6-1dfd6/missing: Unknown `--is-lightweight' option
Try `/Users/ron/Library/Caches/CocoaPods/Pods/Release/Flipper-Glog/0.3.6-1dfd6/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
configure: error: in `/Users/ron/Library/Caches/CocoaPods/Pods/Release/Flipper-Glog/0.3.6-1dfd6':
configure: error: C compiler cannot create executables
See `config.log' for more details
roncodes commented 3 years ago

@fighter520 Thanks the first thread helped me solve my issue but it's a bit hacky.

The comment https://github.com/facebook/react-native/issues/29101#issuecomment-663380161 did the trick for me.

  1. edit node_modules/react-native/scripts/ios-configure-glog.sh
  2. comment out the default export CC and CXX export and replace with the path to my gcc compiler like such
export CC=/usr/local/Cellar/gcc/11.2.0/bin/gcc-11
export CXX=/usr/local/Cellar/gcc/11.2.0/bin/g++-11

🎉 Thanks to this solution I can now install pods but I will continue looking into why the default CC path is wrong.

roncodes commented 3 years ago

Still having the issue as the workaround above works for building and running the app, but when it comes time to archive and upload to iTunes the app is unable to archive due to not being compiled correctly.

The compiler should be /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk

but this is where my pod install fails everytime.

roncodes commented 3 years ago

Found the issue and the actual fix.

I had LDFLAGS and CPPFLAGS set in my ~/.zshrc courtesy of my llvm install via homebrew, like so

export LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"
export CPPFLAGS="-I/usr/local/opt/llvm/include"

I simply unset them restart and now pod install and everything works, like so.

# export LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"
# export CPPFLAGS="-I/usr/local/opt/llvm/include"
jrhe commented 2 years ago

@roncodes fix worked for me. I had also installed llvm/clang via homebrew and set my LDFLAGS and CPPFLAGS flags in ~/.zshrc.

If you don't want to comment them out in your .zshrc, you can also just unset them in your current session by calling unset LDFLAGS, unset CPPFLAGS, and then re-run the install command.

mohzameer commented 2 years ago

No solutions above worked for me. I haven't even set LDFLAGS or CPPFLAGS. It just worked for me with this code pod install --repo-update

DodoSpringLove commented 2 years ago

Found the issue and the actual fix.

I had LDFLAGS and CPPFLAGS set in my ~/.zshrc courtesy of my llvm install via homebrew, like so

export LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"
export CPPFLAGS="-I/usr/local/opt/llvm/include"

I simply unset them restart and now pod install and everything works, like so.

# export LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"
# export CPPFLAGS="-I/usr/local/opt/llvm/include"

Great job... it sovle me problem