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 installation getting failed for 0.73.1 #42048

Closed
vksgautam1986 opened this issue Dec 22, 2023 · 10 comments
Closed

pod installation getting failed for 0.73.1 #42048

vksgautam1986 opened this issue Dec 22, 2023 · 10 comments
Labels
Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Needs: Triage 🔍

Comments

@vksgautam1986
Copy link

vksgautam1986 commented Dec 22, 2023

Description

installation****
i have updated my project from 0.72.7 to 0.73.1 and android working fine but there is some issue during pod installation

Steps to reproduce

  1. cd ios
  2. pod install

React Native Version

0.73.1

Affected Platforms

Runtime - iOS

Output of npx react-native info

System:
  OS: macOS 13.6
  CPU: (8) arm64 Apple M1
  Memory: 60.02 MB / 8.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.1.0
    path: ~/.nvm/versions/node/v18.1.0/bin/node
  Yarn:
    version: 1.22.19
    path: /opt/homebrew/bin/yarn
  npm:
    version: 8.5.0
    path: ~/Desktop/Caresmartz/Test/AwesomeProject/node_modules/.bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.12.1
    path: /Users/netsmartz/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 22.4
      - iOS 16.4
      - macOS 13.3
      - tvOS 16.4
      - watchOS 9.4
  Android SDK: Not Found
IDEs:
  Android Studio: 2022.3 AI-223.8836.35.2231.10811636
  Xcode:
    version: 14.3.1/14E300b
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.9
    path: /usr/bin/javac
  Ruby:
    version: 2.7.4
    path: /Users/netsmartz/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.1
    wanted: 0.73.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: false

Stacktrace or Logs

[!] /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

# @lint-ignore-every TXT2 Tab Literal
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.bak -e 's/\@ac_cv_have_libgflags\@/0/' src/glog/logging.h.in && rm src/glog/logging.h.in.bak
sed -i.bak -e 's/HAVE_LIB_GFLAGS/HAVE_LIB_GFLAGS_DISABLED/' src/config.h.in && rm src/config.h.in.bak

./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... 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... /Users/netsmartz/Downloads/Xcode 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch arm64 -isysroot /Users/netsmartz/Downloads/Xcode 2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk
checking whether the C compiler works... no
/Users/netsmartz/Library/Caches/CocoaPods/Pods/External/glog/2263bd123499e5b93b5efe24871be317-c5d68/missing: Unknown `--is-lightweight' option
Try `/Users/netsmartz/Library/Caches/CocoaPods/Pods/External/glog/2263bd123499e5b93b5efe24871be317-c5d68/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
configure: error: in `/Users/netsmartz/Library/Caches/CocoaPods/Pods/External/glog/2263bd123499e5b93b5efe24871be317-c5d68':
configure: error: C compiler cannot create executables
See `config.log' for more details

Reproducer

https://github.com/vksgautam1986/seventyThree

Screenshots and Videos

Error during pod installation. Test
Screenshot 2023-12-22 at 4 22 10 PM

@lucaswitch
Copy link

@vksgautam1986 i can see that your react-native info has some weird infos: hermesEnabled: Not found

@tyhudson
Copy link

I upgraded from 0.72.5 to 0.73.1 and nothing is working for pods.

image

Let me know if you find a fix to pods... might end up porting over to a new react native project again.

@lucaswitch
Copy link

Can you execute on ios directory:
bundle exec pod install and if not works can you paste your podfile here?
This must be some mistake(maybe) on the podfile

@vksgautam1986
Copy link
Author

bundle exec pod install

hermas is getting installed but it getting failed in later stage
Fetching podspec for hermes-engine from ../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec
[Hermes] Using release tarball from URL: https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.73.1/react-native-artifacts-0.73.1-hermes-ios-debug.tar.gz

@cipolleschi
Copy link
Contributor

@tyhudson please, open your ios/Podfile file and remove the __apply_Xcode_12_5_M1_post_install_workaround function. You probably skipped the Podfile from the upgrade-helper when upgrading to the new version.

@vksgautam1986 This seems like that the glog prepare step failed somehow, so glog was not configured properly.
Please try the following steps:

  1. navigate to the ios folder.
  2. if you haven't run it yet, please run bundle install
  3. run bundle exec pod deintegrate
  4. run bundle exec pod install
    Let me know if that fixes.

@vksgautam1986
Copy link
Author

vksgautam1986 commented Dec 28, 2023

4. bundle exec pod install

navigate to the ios folder.
if you haven't run it yet, please run bundle install
run bundle exec pod deintegrate
run bundle exec pod install

thanks @cipolleschi i tried these steps but it did not worked for me and giving me the same issue
i have a reproducer attached for it

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Dec 28, 2023
@cortinico cortinico added Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. and removed Needs: Attention Issues where the author has responded to feedback. labels Dec 28, 2023
@cipolleschi
Copy link
Contributor

I tried cloning your project and it worked for me.

I believe that your xcode installation failed or is incomplete. The actual error is reported at the end of the message and it is:

checking whether the C compiler works... no

The solution should be to run

xcode-select --install

or to update Xcode from "Software Update" or to reinstall Xcode.

Out of curiosity, have you ever tried to open Xcode? It could also be that you updated it and just missed a last configuration step that is triggered only when you open the IDE.
Also, this could also be because there are no simulator installed: Xcode 15 comes with no iOS simulators, thus no iOS SDKs so they need to be installed manually.

For sanity check, can you provide these values:

  1. Run xcodebuild -version
  2. Run xcode-select -p
  3. Run xcrun -version
  4. Run xcrun -find -sdk iphoneos cc # -> this should output a path to the cc executable
  5. Run xcrun -sdk iphoneos --show-sdk-path # -> this should output a path to the iphone SDK

@vksgautam1
Copy link

vksgautam1 commented Dec 28, 2023

I tried cloning your project and it worked for me.

I believe that your xcode installation failed or is incomplete. The actual error is reported at the end of the message and it is:

checking whether the C compiler works... no

The solution should be to run

xcode-select --install

or to update Xcode from "Software Update" or to reinstall Xcode.

Out of curiosity, have you ever tried to open Xcode? It could also be that you updated it and just missed a last configuration step that is triggered only when you open the IDE. Also, this could also be because there are no simulator installed: Xcode 15 comes with no iOS simulators, thus no iOS SDKs so they need to be installed manually.

For sanity check, can you provide these values:

  1. Run xcodebuild -version
  2. Run xcode-select -p
  3. Run xcrun -version
  4. Run xcrun -find -sdk iphoneos cc # -> this should output a path to the cc executable
  5. Run xcrun -sdk iphoneos --show-sdk-path # -> this should output a path to the iphone SDK

I'm vksgautam1986 From my personal account - I'm using 14.2 And 14.3.1 xcode and I can create builds for ios from it. Rest for all of queries I will post here once I would be on system tomm morning. Thank you @cipolleschi
I also feel something is wrong with my xcode environment and I will try to go through it in more detail

@vksgautam1986
Copy link
Author

Hi @cipolleschi

  1. xcodebuild -version
    Xcode 14.3.1
    Build version 14E300b

  2. xcode-select -p
    /Users/netsmartz/Downloads/Xcode 2.app/Contents/Developer

  3. xcrun -version
    xcrun version 64.

  4. xcrun -find -sdk iphoneos cc
    /Users/netsmartz/Downloads/Xcode 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc

  5. xcrun -sdk iphoneos --show-sdk-path
    /Users/netsmartz/Downloads/Xcode 2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk

@vksgautam1986
Copy link
Author

vksgautam1986 commented Dec 29, 2023

Hi @cipolleschi i tried the link below and able to install the pods also .i installed second xcode few days ago and there could be some issue bcs of that. Thank you i switched to primary Xcode.app , may be bcs i have space in my second xcode naming "Xcode 2", that could be the reason but nevertheless its working fine now. thank you.
react-native-community/cli#1194 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Needs: Triage 🔍
Projects
None yet
Development

No branches or pull requests

6 participants