Skip to content
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

pod install failed due to glog during project initialisation #34443

Closed
sailinz opened this issue Aug 18, 2022 · 5 comments
Closed

pod install failed due to glog during project initialisation #34443

sailinz opened this issue Aug 18, 2022 · 5 comments
Labels
Resolution: Answered When the issue is resolved with a simple answer Resolution: Issue in another tool or repo An issue that was opened against React Native but in reality is affecting another tool or library

Comments

@sailinz
Copy link

sailinz commented Aug 18, 2022

Description

Got the below error

patching file config.sub
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-apple-darwin-strip... x86_64-apple-darwin13.4.0-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 arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.5.sdk
checking whether the C compiler works... no
/Applications/anaconda3/bin/install: line 34: /bin/R: No such file or directory
/Users/xx/Library/Caches/CocoaPods/Pods/External/glog/2263bd123499e5b93b5efe24871be317-3d02b/missing: Unknown --is-lightweight option
Try /Users/xx/Library/Caches/CocoaPods/Pods/External/glog/2263bd123499e5b93b5efe24871be317-3d02b/missing --help for more information
configure: WARNING: missing script is too old or missing
configure: error: in /Users/xx/Library/Caches/CocoaPods/Pods/External/glog/2263bd123499e5b93b5efe24871be317-3d02b:
configure: error: C compiler cannot create executables
See config.log for more details

When following the initialization guide: https://reactnative.dev/docs/environment-setup (MacOS and iOS).

Version

0.69.4

Output of npx react-native info

System:
    OS: macOS 12.5
    CPU: (8) x64 Intel(R) Core(TM) i7-8569U CPU @ 2.80GHz
    Memory: 200.84 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 18.7.0 - ~/.nvm/versions/node/v18.7.0/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 8.17.0 - ~/.nvm/versions/node/v18.7.0/bin/npm
    Watchman: 2022.08.15.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.1 AI-211.7628.21.2111.8193401
    Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_332-internal - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: ^0.69.4 => 0.69.4 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps to reproduce

I follow the guide (https://reactnative.dev/docs/environment-setup). After "npx react-native init AwesomeProject", the following error pops up:

✔ 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 ./ReactNativeAttentionTestApp/ios && pod install".

After running "cd ./ReactNativeAttentionTestApp/ios && pod install", the issue occurs.

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

cd ./ReactNativeAttentionTestApp/ios && pod install
[Codegen] Generating ./build/generated/ios/React-Codegen.podspec.json
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
[Codegen] Found FBReactNativeSpec
Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`
Fetching podspec for `boost` from `../node_modules/react-native/third-party-podspecs/boost.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.69.4)
Installing FBReactNativeSpec (0.69.4)
Installing Flipper (0.125.0)
Installing Flipper-Boost-iOSX (1.76.0.1.11)
Installing Flipper-DoubleConversion (3.2.0.1)
Installing Flipper-Fmt (7.1.7)
Installing Flipper-Folly (2.6.10)
Installing Flipper-Glog (0.5.0.5)
Installing Flipper-PeerTalk (0.0.4)
Installing Flipper-RSocket (1.4.3)
Installing FlipperKit (0.125.0)
Installing OpenSSL-Universal (1.1.1100)
Installing RCT-Folly (2021.06.28.00-v2)
Installing RCTRequired (0.69.4)
Installing RCTTypeSafety (0.69.4)
Installing React (0.69.4)
Installing React-Codegen (0.69.4)
Installing React-Core (0.69.4)
Installing React-CoreModules (0.69.4)
Installing React-RCTActionSheet (0.69.4)
Installing React-RCTAnimation (0.69.4)
Installing React-RCTBlob (0.69.4)
Installing React-RCTImage (0.69.4)
Installing React-RCTLinking (0.69.4)
Installing React-RCTNetwork (0.69.4)
Installing React-RCTSettings (0.69.4)
Installing React-RCTText (0.69.4)
Installing React-RCTVibration (0.69.4)
Installing React-bridging (0.69.4)
Installing React-callinvoker (0.69.4)
Installing React-cxxreact (0.69.4)
Installing React-jsi (0.69.4)
Installing React-jsiexecutor (0.69.4)
Installing React-jsinspector (0.69.4)
Installing React-logger (0.69.4)
Installing React-perflogger (0.69.4)
Installing React-runtimeexecutor (0.69.4)
Installing ReactCommon (0.69.4)
Installing SocketRocket (0.6.0)
Installing Yoga (1.14.0)
Installing YogaKit (1.18.1)
Installing boost (1.76.0)
Installing fmt (6.2.1)
Installing glog (0.3.5)
[!] /bin/bash -c 
set -e
#!/bin/bash
# Copyright (c) Meta Platforms, Inc. and 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="arm64"
    fi
fi

if [ "$CURRENT_ARCH" == "arm64" ]; then
    cat <<\EOF >>fix_glog_0.3.5_apple_silicon.patch
diff --git a/config.sub b/config.sub
index 1761d8b..43fa2e8 100755
--- a/config.sub
+++ b/config.sub
@@ -1096,6 +1096,9 @@ case $basic_machine in
 		basic_machine=z8k-unknown
 		os=-sim
 		;;
+	arm64-*)
+		basic_machine=$(echo $basic_machine | sed 's/arm64/aarch64/')
+		;;
 	none)
 		basic_machine=none-none
 		os=-none
EOF

    patch -p1 config.sub fix_glog_0.3.5_apple_silicon.patch
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

# Manually disable gflags include to fix issue https://github.com/facebook/react-native/issues/28446
sed -i '' 's/\@ac_cv_have_libgflags\@/0/' src/glog/logging.h.in
sed -i '' 's/HAVE_LIB_GFLAGS/HAVE_LIB_GFLAGS_DISABLED/' src/config.h.in

./configure --host arm-apple-darwin

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 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/"

patching file config.sub
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-apple-darwin-strip... x86_64-apple-darwin13.4.0-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 arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.5.sdk
checking whether the C compiler works... no
/Applications/anaconda3/bin/install: line 34: /bin/R: No such file or directory
/Users/zhongs/Library/Caches/CocoaPods/Pods/External/glog/2263bd123499e5b93b5efe24871be317-3d02b/missing: Unknown `--is-lightweight' option
Try `/Users/zhongs/Library/Caches/CocoaPods/Pods/External/glog/2263bd123499e5b93b5efe24871be317-3d02b/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
configure: error: in `/Users/zhongs/Library/Caches/CocoaPods/Pods/External/glog/2263bd123499e5b93b5efe24871be317-3d02b':
configure: error: C compiler cannot create executables
See `config.log' for more details

@cortinico
Copy link
Contributor

Potentially related to:
google/glog#799
google/glog#544

Can you run env and share your output? You might have some environment variables which are messing up your compiler setup.

Also have you installed XCode? Could you run react-native doctor and share the output?

@sailinz
Copy link
Author

sailinz commented Aug 18, 2022

Thanks for looking into this!

I'm using XCode Version 13.4.1 (13F100) and have select Command Line Tools from its Locations tab. I also tried:

sudo xcode-select --switch /Applications/Xcode.app

react-native doctor:

warn Package rn-fetch-blob contains invalid configuration: "dependency.hooks" is not allowed. Please verify it's properly linked using "react-native config" command and contact the package maintainers about this.
⠋ Running diagnostics...(node:19438) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
⠋ Running diagnostics...warn Package rn-fetch-blob contains invalid configuration: "dependency.hooks" is not allowed. Please verify it's properly linked using "react-native config" command and contact the package maintainers about this.
Common
 ✓ Node.js
 ✓ yarn
 ✓ Watchman - Used for watching changes in the filesystem when in development mode

Android
 ✓ JDK
 ✓ Android Studio - Required for building and installing your app on Android
 ✖ Android SDK - Required for building and installing your app on Android
   - Versions found: N/A
   - Version supported: 30.0.2
 ✖ ANDROID_HOME

iOS
 ✓ Xcode - Required for building and installing your app on iOS
 ✓ CocoaPods - Required for installing iOS dependencies
 ● ios-deploy - Required for installing your app on a physical device with the CLI
 ✖ .xcode.env - File to customize Xcode environment

Errors:   3
Warnings: 1

Usage
 › Press f to try to fix issues.
 › Press e to try to fix errors.
 › Press w to try to fix warnings.
 › Press Enter to exit.


env:

NVM_INC=/Users/zhongs/.nvm/versions/node/v18.7.0/include/node
AS=x86_64-apple-darwin13.4.0-as
LDFLAGS=-Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/Applications/anaconda3/lib -L/Applications/anaconda3/lib
AR=x86_64-apple-darwin13.4.0-ar
ac_cv_func_malloc_0_nonnull=yes
TERM_PROGRAM=Apple_Terminal
ac_cv_func_realloc_0_nonnull=yes
NVM_CD_FLAGS=
OBJC=x86_64-apple-darwin13.4.0-clang
HOST=x86_64-apple-darwin13.4.0
SHELL=/bin/bash
TERM=xterm-256color
NM=x86_64-apple-darwin13.4.0-nm
CPPFLAGS=-D_FORTIFY_SOURCE=2 -isystem /Applications/anaconda3/include
TMPDIR=/var/folders/84/85yg3v756w90md_90mkspt3d0j0qsw/T/
PAGESTUFF=x86_64-apple-darwin13.4.0-pagestuff
CONDA_SHLVL=2
LIPO=x86_64-apple-darwin13.4.0-lipo
CONDA_PROMPT_MODIFIER=(base) 
TERM_PROGRAM_VERSION=445
SIZE=x86_64-apple-darwin13.4.0-size
NMEDIT=x86_64-apple-darwin13.4.0-nmedit
SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
OLDPWD=/Users/zhongs/Desktop/MediaLab/visual_comfort/React_native
TERM_SESSION_ID=4A60BA2A-F557-41A3-83B9-4027C2E36AE5
CXX_FOR_BUILD=/Applications/anaconda3/bin/x86_64-apple-darwin13.4.0-clang++
INSTALL_NAME_TOOL=x86_64-apple-darwin13.4.0-install_name_tool
SEGEDIT=x86_64-apple-darwin13.4.0-segedit
GFORTRAN=/Applications/anaconda3/bin/x86_64-apple-darwin13.4.0-gfortran
NVM_DIR=/Users/zhongs/.nvm
SEG_HACK=x86_64-apple-darwin13.4.0-seg_hack
USER=zhongs
CLANGXX=x86_64-apple-darwin13.4.0-clang++
LIBTOOL=x86_64-apple-darwin13.4.0-libtool
CONDA_BACKUP_HOST=x86_64-apple-darwin13.4.0
CONDA_TOOLCHAIN_BUILD=x86_64-apple-darwin13.4.0
CONDA_EXE=/Applications/anaconda3/bin/conda
OTOOL=x86_64-apple-darwin13.4.0-otool
CPATH=/Library/Developer/CommandLineTools/usr/include/c++/v1
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.VLaReBRP5X/Listeners
DEBUG_FORTRANFLAGS=-march=nocona -mtune=core2 -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -march=nocona -mtune=core2 -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -Og -g -Wall -Wextra -fcheck=all -fbacktrace -fimplicit-none -fvar-tracking-assignments
CXXFLAGS=-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -std=c++14 -fmessage-length=0 -isystem /Applications/anaconda3/include
STRINGS=x86_64-apple-darwin13.4.0-strings
CONDA_TOOLCHAIN_HOST=x86_64-apple-darwin13.4.0
_CE_CONDA=
CHECKSYMS=x86_64-apple-darwin13.4.0-checksyms
CONDA_PREFIX_1=/Users/zhongs/anaconda3
PATH=/Users/zhongs/.rbenv/shims:/Users/zhongs/.nvm/versions/node/v18.7.0/bin:/Applications/anaconda3/bin:/Users/zhongs/anaconda3/condabin:/anaconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands
MESON_ARGS=--buildtype release
LaunchInstanceID=221F40C2-82E9-45D7-AB64-4EADCF0202C3
DEBUG_CXXFLAGS=-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -std=c++14 -fmessage-length=0 -Og -g -Wall -Wextra -isystem /Applications/anaconda3/include
BUILD=x86_64-apple-darwin13.4.0
LD=x86_64-apple-darwin13.4.0-ld
CONDA_PREFIX=/Applications/anaconda3
__CFBundleIdentifier=com.apple.Terminal
F90=/Applications/anaconda3/bin/x86_64-apple-darwin13.4.0-gfortran
PWD=/Users/zhongs/Desktop/MediaLab/visual_comfort/React_native/reactnative-attentionapp-main
JAVA_HOME=/Library/Java/JavaVirtualMachines/openlogic-openjdk-8.jdk/Contents/Home
STRIP=x86_64-apple-darwin13.4.0-strip
CMAKE_ARGS=-DCMAKE_AR=/Applications/anaconda3/bin/x86_64-apple-darwin13.4.0-ar -DCMAKE_CXX_COMPILER_AR=/Applications/anaconda3/bin/x86_64-apple-darwin13.4.0-ar -DCMAKE_C_COMPILER_AR=/Applications/anaconda3/bin/x86_64-apple-darwin13.4.0-ar -DCMAKE_RANLIB=/Applications/anaconda3/bin/x86_64-apple-darwin13.4.0-ranlib -DCMAKE_CXX_COMPILER_RANLIB=/Applications/anaconda3/bin/x86_64-apple-darwin13.4.0-ranlib -DCMAKE_C_COMPILER_RANLIB=/Applications/anaconda3/bin/x86_64-apple-darwin13.4.0-ranlib -DCMAKE_LINKER=/Applications/anaconda3/bin/x86_64-apple-darwin13.4.0-ld -DCMAKE_STRIP=/Applications/anaconda3/bin/x86_64-apple-darwin13.4.0-strip -DCMAKE_INSTALL_NAME_TOOL=/Applications/anaconda3/bin/x86_64-apple-darwin13.4.0-install_name_tool -DCMAKE_LIBTOOL=/Applications/anaconda3/bin/x86_64-apple-darwin13.4.0-libtool -DCMAKE_OSX_DEPLOYMENT_TARGET= -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
F95=/Applications/anaconda3/bin/x86_64-apple-darwin13.4.0-gfortran
DEBUG_FFLAGS=-march=nocona -mtune=core2 -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -march=nocona -mtune=core2 -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -Og -g -Wall -Wextra -fcheck=all -fbacktrace -fimplicit-none -fvar-tracking-assignments
XPC_FLAGS=0x0
F77=/Applications/anaconda3/bin/x86_64-apple-darwin13.4.0-gfortran
REDO_PREBINDING=x86_64-apple-darwin13.4.0-redo_prebinding
RBENV_SHELL=bash
CXX=x86_64-apple-darwin13.4.0-clang++
CC_FOR_BUILD=/Applications/anaconda3/bin/x86_64-apple-darwin13.4.0-clang
CLANG=x86_64-apple-darwin13.4.0-clang
_CE_M=
XPC_SERVICE_NAME=0
SHLVL=1
HOME=/Users/zhongs
FORTRANFLAGS=-march=nocona -mtune=core2 -ftree-vectorize -fPIC -fstack-protector -O2 -pipe
CFLAGS=-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Applications/anaconda3/include
_CONDA_PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_x86_64_apple_darwin13_4_0
FC=/Applications/anaconda3/bin/x86_64-apple-darwin13.4.0-gfortran
INDR=x86_64-apple-darwin13.4.0-indr
CONDA_PYTHON_EXE=/Applications/anaconda3/bin/python
LOGNAME=zhongs
build_alias=x86_64-apple-darwin13.4.0
LC_CTYPE=UTF-8
NVM_BIN=/Users/zhongs/.nvm/versions/node/v18.7.0/bin
CONDA_DEFAULT_ENV=base
DEBUG_CFLAGS=-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -Og -g -Wall -Wextra -isystem /Applications/anaconda3/include
RANLIB=x86_64-apple-darwin13.4.0-ranlib
CMAKE_PREFIX_PATH=:/Applications/anaconda3
CC=x86_64-apple-darwin13.4.0-clang
SEG_ADDR_TABLE=x86_64-apple-darwin13.4.0-seg_addr_table
host_alias=x86_64-apple-darwin13.4.0
LDFLAGS_LD=-pie -headerpad_max_install_names -dead_strip_dylibs -rpath /Applications/anaconda3/lib -L/Applications/anaconda3/lib
SECURITYSESSIONID=186a3
OBJC_FOR_BUILD=/Applications/anaconda3/bin/x86_64-apple-darwin13.4.0-clang
FFLAGS=-march=nocona -mtune=core2 -ftree-vectorize -fPIC -fstack-protector -O2 -pipe
_=/usr/bin/env

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Aug 18, 2022
@cortinico
Copy link
Contributor

Closing as this is not a React Native issue.
It seems like you installed anaconda3 which messed up your environment.

First, I would try to remove the remove the CPATH variable with unset CPATH and try to pod install again. Please note that whenever you re-open a terminal you'll have CPATH set again.

Plus your environment is full of custom flags. You will most likely have other problems.

I would try to:

unset LDFLAGS && \
unset NVM_CD_FLAGS && \
unset CPPFLAGS && \
unset DEBUG_FORTRANFLAGS && \
unset CXXFLAGS && \
unset DEBUG_CXXFLAGS && \
unset DEBUG_FFLAGS && \
unset FORTRANFLAGS && \
unset CFLAGS && \
unset DEBUG_CFLAGS && \
unset LDFLAGS && \
unset FFLAGS

(or a combination of those) and try to pod install. As an alternative, you can tweak your .zshrc/.bashrc (or any other rc file) to make sure those flags are not configured as they're affecting your environment

@cortinico cortinico added Resolution: Answered When the issue is resolved with a simple answer Resolution: Issue in another tool or repo An issue that was opened against React Native but in reality is affecting another tool or library and removed Needs: Attention Issues where the author has responded to feedback. labels Aug 18, 2022
@sailinz
Copy link
Author

sailinz commented Aug 18, 2022

Thanks!

I removed these flags and clear the anaconda3 added stuff in the ./bash_profile file and pod install succeeded!

@pche2020
Copy link

swift集成RN,pod install之后就报错/Users/hepengcheng/.rvm/gems/ruby-2.7.5/gems/cocoapods-1.11.3/lib/cocoapods/user_interface/error_report.rb:34:in `force_encoding': can't modify frozen String: "relative URI: /Users/hepengcheng/Desktop/ReactNative&Native/testReactNative/ios/node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" (FrozenError) 这个如何解决呢

下面是打印信息

pod install
Analyzing dependencies
Fetching podspec for DoubleConversion from ../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec
Traceback (most recent call last):
28: from /Users/hepengcheng/.rvm/gems/ruby-2.7.5/bin/ruby_executable_hooks:22:in <main>' 27: from /Users/hepengcheng/.rvm/gems/ruby-2.7.5/bin/ruby_executable_hooks:22:in eval'
26: from /Users/hepengcheng/.rvm/gems/ruby-2.7.5/bin/pod:23:in <main>' 25: from /Users/hepengcheng/.rvm/gems/ruby-2.7.5/bin/pod:23:in load'
24: from /Users/hepengcheng/.rvm/gems/ruby-2.7.5/gems/cocoapods-1.11.3/bin/pod:55:in <top (required)>' 23: from /Users/hepengcheng/.rvm/gems/ruby-2.7.5/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in run'
22: from /Users/hepengcheng/.rvm/rubies/ruby-2.7.5/lib/ruby/gems/2.7.0/gems/claide-1.1.0/lib/claide/command.rb:334:in run' 21: from /Users/hepengcheng/.rvm/gems/ruby-2.7.5/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:52:in run'
20: from /Users/hepengcheng/.rvm/gems/ruby-2.7.5/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:161:in install!' 19: from /Users/hepengcheng/.rvm/gems/ruby-2.7.5/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:240:in resolve_dependencies'
18: from /Users/hepengcheng/.rvm/gems/ruby-2.7.5/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in section' 17: from /Users/hepengcheng/.rvm/gems/ruby-2.7.5/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:241:in block in resolve_dependencies'
16: from /Users/hepengcheng/.rvm/gems/ruby-2.7.5/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:416:in analyze' 15: from /Users/hepengcheng/.rvm/gems/ruby-2.7.5/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:117:in analyze'
14: from /Users/hepengcheng/.rvm/gems/ruby-2.7.5/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:970:in fetch_external_sources' 13: from /Users/hepengcheng/.rvm/gems/ruby-2.7.5/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in section'
12: from /Users/hepengcheng/.rvm/gems/ruby-2.7.5/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:971:in block in fetch_external_sources' 11: from /Users/hepengcheng/.rvm/gems/ruby-2.7.5/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:971:in each'
10: from /Users/hepengcheng/.rvm/gems/ruby-2.7.5/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:972:in block (2 levels) in fetch_external_sources' 9: from /Users/hepengcheng/.rvm/gems/ruby-2.7.5/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:993:in fetch_external_source'
8: from /Users/hepengcheng/.rvm/gems/ruby-2.7.5/gems/cocoapods-1.11.3/lib/cocoapods/external_sources/podspec_source.rb:11:in fetch' 7: from /Users/hepengcheng/.rvm/gems/ruby-2.7.5/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:86:in titled_section'
6: from /Users/hepengcheng/.rvm/gems/ruby-2.7.5/gems/cocoapods-1.11.3/lib/cocoapods/external_sources/podspec_source.rb:19:in block in fetch' 5: from /Users/hepengcheng/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/open-uri.rb:174:in open_uri'
4: from /Users/hepengcheng/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/open-uri.rb:233:in open_loop' 3: from /Users/hepengcheng/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/open-uri.rb:233:in catch'
2: from /Users/hepengcheng/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/open-uri.rb:235:in block in open_loop' 1: from /Users/hepengcheng/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/open-uri.rb:218:in block in open_loop'
/Users/hepengcheng/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/uri/generic.rb:1491:in find_proxy': relative URI: /Users/hepengcheng/Desktop/ReactNative&Native/testReactNative/ios/node_modules/react-native/third-party-podspecs/DoubleConversion.podspec (URI::BadURIError) 11: from /Users/hepengcheng/.rvm/gems/ruby-2.7.5/bin/ruby_executable_hooks:22:in

'
10: from /Users/hepengcheng/.rvm/gems/ruby-2.7.5/bin/ruby_executable_hooks:22:in eval' 9: from /Users/hepengcheng/.rvm/gems/ruby-2.7.5/bin/pod:23:in '
8: from /Users/hepengcheng/.rvm/gems/ruby-2.7.5/bin/pod:23:in load' 7: from /Users/hepengcheng/.rvm/gems/ruby-2.7.5/gems/cocoapods-1.11.3/bin/pod:55:in <top (required)>'
6: from /Users/hepengcheng/.rvm/gems/ruby-2.7.5/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in run' 5: from /Users/hepengcheng/.rvm/rubies/ruby-2.7.5/lib/ruby/gems/2.7.0/gems/claide-1.1.0/lib/claide/command.rb:324:in run'
4: from /Users/hepengcheng/.rvm/rubies/ruby-2.7.5/lib/ruby/gems/2.7.0/gems/claide-1.1.0/lib/claide/command.rb:337:in rescue in run' 3: from /Users/hepengcheng/.rvm/rubies/ruby-2.7.5/lib/ruby/gems/2.7.0/gems/claide-1.1.0/lib/claide/command.rb:396:in handle_exception'
2: from /Users/hepengcheng/.rvm/gems/ruby-2.7.5/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:66:in report_error' 1: from /Users/hepengcheng/.rvm/gems/ruby-2.7.5/gems/cocoapods-1.11.3/lib/cocoapods/user_interface/error_report.rb:34:in report'
/Users/hepengcheng/.rvm/gems/ruby-2.7.5/gems/cocoapods-1.11.3/lib/cocoapods/user_interface/error_report.rb:34:in `force_encoding': can't modify frozen String: "relative URI: /Users/hepengcheng/Desktop/ReactNative&Native/testReactNative/ios/node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" (FrozenError)

env
TERM_SESSION_ID=w0t0p0:65EB9C65-7107-4743-92EF-544984736C04
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.7e7Xc29z5H/Listeners
LC_TERMINAL_VERSION=3.4.15
COLORFGBG=15;0
ITERM_PROFILE=Hpc
XPC_FLAGS=0x0
LANG=zh_CN.UTF-8
PWD=/Users/hepengcheng/Desktop/ReactNative&Native/testReactNative/ios/App-iOS-New
SHELL=/bin/zsh
__CFBundleIdentifier=com.googlecode.iterm2
TERM_PROGRAM_VERSION=3.4.15
TERM_PROGRAM=iTerm.app
PATH=/Users/hepengcheng/.rvm/gems/ruby-2.7.5/bin:/Users/hepengcheng/.rvm/gems/ruby-2.7.5@global/bin:/Users/hepengcheng/.rvm/rubies/ruby-2.7.5/bin:/Users/hepengcheng/Documents/flutter/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/hepengcheng/Library/Android/sdk/tools:/Users/hepengcheng/Library/Android/sdk/platform-tools:/Users/hepengcheng/.rvm/bin
LC_TERMINAL=iTerm2
COLORTERM=truecolor
COMMAND_MODE=unix2003
TERM=xterm-256color
HOME=/Users/hepengcheng
TMPDIR=/var/folders/j6/62b37k4x1z788t1shkyd_6tc0000gn/T/
USER=John_H
XPC_SERVICE_NAME=0
LOGNAME=John_H
ITERM_SESSION_ID=w0t0p0:65EB9C65-7107-4743-92EF-544984736C04
__CF_USER_TEXT_ENCODING=0x0:25:52
SHLVL=1
OLDPWD=/Users/hepengcheng
HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles
HOMEBREW_PREFIX=/opt/homebrew
HOMEBREW_CELLAR=/opt/homebrew/Cellar
HOMEBREW_REPOSITORY=/opt/homebrew
MANPATH=/opt/homebrew/share/man::
INFOPATH=/opt/homebrew/share/info:
P9K_TTY=old
_P9K_TTY=/dev/ttys002
PUB_HOSTED_URL=https://pub.flutter-io.cn
FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
FLUTTER=/Users/hepengcheng/Documents/flutter
ANDROID_HOME=/Users/hepengcheng/Library/Android/sdk
ZSH=/Users/hepengcheng/.oh-my-zsh
PAGER=less
LESS=-R
LSCOLORS=Gxfxcxdxbxegedabagacad
P9K_SSH=0
AUTOJUMP_SOURCED=1
AUTOJUMP_ERROR_PATH=/Users/hepengcheng/Library/autojump/errors.log
rvm_prefix=/Users/hepengcheng
rvm_path=/Users/hepengcheng/.rvm
rvm_bin_path=/Users/hepengcheng/.rvm/bin
rvm_version=1.29.12 (latest)
GEM_HOME=/Users/hepengcheng/.rvm/gems/ruby-2.7.5
GEM_PATH=/Users/hepengcheng/.rvm/gems/ruby-2.7.5:/Users/hepengcheng/.rvm/gems/ruby-2.7.5@global
MY_RUBY_HOME=/Users/hepengcheng/.rvm/rubies/ruby-2.7.5
IRBRC=/Users/hepengcheng/.rvm/rubies/ruby-2.7.5/.irbrc
RUBY_VERSION=ruby-2.7.5
rvm_alias_expanded=
rvm_bin_flag=
rvm_docs_type=
rvm_gemstone_package_file=
rvm_gemstone_url=
rvm_niceness=
rvm_nightly_flag=
rvm_only_path_flag=
rvm_pretty_print_flag=
rvm_proxy=
rvm_quiet_flag=
rvm_ruby_bits=
rvm_ruby_file=
rvm_ruby_make=
rvm_ruby_make_install=
rvm_ruby_mode=
rvm_script_name=
rvm_sdk=
rvm_silent_flag=
rvm_use_flag=
rvm_hook=
_=/usr/bin/env

@facebook facebook locked as spam and limited conversation to collaborators Oct 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Answered When the issue is resolved with a simple answer Resolution: Issue in another tool or repo An issue that was opened against React Native but in reality is affecting another tool or library
Projects
None yet
Development

No branches or pull requests

3 participants