Closed Bayramito closed 1 year ago
Same
Actually its working if i disable hermes on Podfile
I solved it by addinghermes.xcframework
file to
xcode > build phases > Link binary with Libraries
section and rebuilding the app
hermes.xcframework
Where did u get hermes.xcframework
?
hermes.xcframework
Where did u get
hermes.xcframework
?
just press to +
sign and search for hermes
hermes.xcframework
Where did u get
hermes.xcframework
?just press to
+
sign and search for hermes![]()
lmao
Temporary fix:
change highlighted area with:
if [[ "$CONFIGURATION" == "Debug" ]]; then
install_framework "${PODS_XCFRAMEWORKS_BUILD_DIR}/Flipper-DoubleConversion/double-conversion.framework"
install_framework "${PODS_XCFRAMEWORKS_BUILD_DIR}/Flipper-Glog/glog.framework"
install_framework "${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL-Universal/OpenSSL.framework"
install_framework "${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/hermes.framework"
fi
if [[ "$CONFIGURATION" == "Release" ]]; then
install_framework "${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/hermes.framework"
fi
DO NOT RUN POD INSTALL
just npx react-native run-ios this should solve the issue but im looking to find out why pod install doesnt add this automatically....
Temporary fix:
change highlighted area with:
![]()
if [[ "$CONFIGURATION" == "Debug" ]]; then install_framework "${PODS_XCFRAMEWORKS_BUILD_DIR}/Flipper-DoubleConversion/double-conversion.framework" install_framework "${PODS_XCFRAMEWORKS_BUILD_DIR}/Flipper-Glog/glog.framework" install_framework "${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL-Universal/OpenSSL.framework" install_framework "${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/hermes.framework" fi if [[ "$CONFIGURATION" == "Release" ]]; then install_framework "${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/hermes.framework" fi
DO NOT RUN POD INSTALL
just npx react-native run-ios this should solve the issue but im looking to find out why pod install doesnt add this automatically....
It works on my side
It woked for me, thanks.
I created this function so you don't have to manually update the Pods frameworks file every time you run pod install
def fix_hermes(app_name)
path = "Pods/Target Support Files/Pods-" + app_name + "/Pods-" + app_name + "-frameworks.sh"
lines = File.readlines(path)
lines.insert(181, ' install_framework "${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/hermes.framework"'+"\n")
lines.insert(183, 'if [[ "$CONFIGURATION" == "Release" ]]; then'+"\n")
lines.insert(184, ' install_framework "${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/hermes.framework"'+"\n")
lines.insert(185, "fi\n")
File.write(path, lines.join, mode: "w")
puts "Hermes fixed"
end
Add it to you Podfile. It should look like this:
And finally call it from the post install script
app_name
is the target
I created this function so you don't have to manually update the Pods frameworks file every time you run pod install
def fix_hermes(app_name) path = "Pods/Target Support Files/Pods-" + app_name + "/Pods-" + app_name + "-frameworks.sh" lines = File.readlines(path) lines.insert(181, ' install_framework "${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/hermes.framework"'+"\n") lines.insert(183, 'if [[ "$CONFIGURATION" == "Release" ]]; then'+"\n") lines.insert(184, ' install_framework "${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/hermes.framework"'+"\n") lines.insert(185, "fi\n") File.write(path, lines.join, mode: "w") puts "Hermes fixed" end
Add it to you Podfile. It should look like this:
![]()
And finally call it from the post install script
![]()
app_name
is the target
Actually you dont need to call it everytime. Xcode as a caching system to store it for the project.
For those still struggling with this, I found that I needed to have CocoaPods v 1.11.2 or higher for it to work correctly.
For those still struggling with this, I found that I needed to have CocoaPods v 1.11.2 or higher for it to work correctly.
Thanks @brandonmoon but i'm on the most recent version 1.11.3, still with this issue
As I commented here, based on the repro steps I don't get the error: https://github.com/facebook/react-native/issues/34612#issuecomment-1243574942
I'm going to close this issue unless someone can provide proper repro steps
:warning: | Missing Reproducible Example |
---|---|
:information_source: | It looks like your issue is missing a reproducible example. Please provide a Snack or a repository that demonstrates the issue you are reporting in a minimal, complete, and reproducible manner. |
Hi @kelset The repro steps are.
npx react-native init testproject then cd testproject && npx react-native run-ios
or even building with in Xcode.
And then Hermes is not included with in the build. Where we are seeing errors like
'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/hermes.framework/hermes' (no such file),
'/usr/lib/swift/hermes.framework/hermes' (no such file),
I have this also with-in my production app after upgrade from 0.69. I don't personally understand why. If it's the operating system, setup or something else.
as I have already mentioned, those repro steps don't lead to me experiencing the issue reported. So yes, it's probably something with your local setup. Please see my other comment for my configuration and try to see if there's any difference.
Ok cool.. you are using an M1 mac and this issue has indicated that this issue is replicated-able on an Intel mac.. could this be the cause ?
System:
OS: macOS 12.5.1
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 1.67 GB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Other wise i'm on the same versions and have tried downgrading upgrading to see if there is a difference.
System:
OS: macOS 12.5.1
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 2.14 GB / 32.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.17.0 - ~/.nvm/versions/node/v16.17.0/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 8.15.0 - ~/.nvm/versions/node/v16.17.0/bin/npm
Watchman: 2022.09.05.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.2 AI-212.5712.43.2112.8609683
Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
Languages:
Java: 11.0.14.1 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.1.0 => 18.1.0
react-native: 0.70.0 => 0.70.0
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
It's not that, I just tested on my intel machine and it also works just fine:
System:
OS: macOS 12.5
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 39.34 GB / 64.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.15.1 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 8.11.0 - /usr/local/bin/npm
Watchman: 2022.07.04.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.3 - /Users/lsciandra/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK:
Android NDK: 21.4.7075529
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8609683
Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
Languages:
Java: 11.0.14 - /Users/lsciandra/.sdkman/candidates/java/current/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.1.0 => 18.1.0
react-native: 0.70.0 => 0.70.0
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not FoundScreenshot 2022-09-13 at 15.23.16.png
screenshot:
@kelset Thanks for your help. I've created a completely fresh install with the repo instructions above. Here is a git repo to view the output
https://github.com/Gnative/reactnative-0.70.0
System:
System:
OS: macOS 12.5.1
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 2.14 GB / 32.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.17.0 - ~/.nvm/versions/node/v16.17.0/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 8.15.0 - ~/.nvm/versions/node/v16.17.0/bin/npm
Watchman: 2022.09.05.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.2 AI-212.5712.43.2112.8609683
Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
Languages:
Java: 11.0.14.1 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.1.0 => 18.1.0
react-native: 0.70.0 => 0.70.0
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
dyld[70938]: Library not loaded: @rpath/hermes.framework/hermes
Referenced from: /Users/Gnative/Library/Developer/CoreSimulator/Devices/D82D1AD7-DCAD-4C4B-A7C2-2AD20C92B86C/data/Containers/Bundle/Application/DD542822-31A0-4F98-A1D7-3C795F33799C/test.app/test
My Pods/Target Support Files/Pods/test/Pods-test-frameworks that missing any linkage to hermes.
#!/bin/sh
set -e
set -u
set -o pipefail
function on_error {
echo "$(realpath -mq "${0}"):$1: error: Unexpected failure"
}
trap 'on_error $LINENO' ERR
if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
# If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
# frameworks to, so exit 0 (signalling the script phase was successful).
exit 0
fi
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
BCSYMBOLMAP_DIR="BCSymbolMaps"
# This protects against multiple targets copying the same framework dependency at the same time. The solution
# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
# Copies and strips a vendored framework
install_framework()
{
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
local source="${BUILT_PRODUCTS_DIR}/$1"
elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
elif [ -r "$1" ]; then
local source="$1"
fi
local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink "${source}")"
fi
if [ -d "${source}/${BCSYMBOLMAP_DIR}" ]; then
# Locate and install any .bcsymbolmaps if present, and remove them from the .framework before the framework is copied
find "${source}/${BCSYMBOLMAP_DIR}" -name "*.bcsymbolmap"|while read f; do
echo "Installing $f"
install_bcsymbolmap "$f" "$destination"
rm "$f"
done
rmdir "${source}/${BCSYMBOLMAP_DIR}"
fi
# Use filter instead of exclude so missing patterns don't throw errors.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
local basename
basename="$(basename -s .framework "$1")"
binary="${destination}/${basename}.framework/${basename}"
if ! [ -r "$binary" ]; then
binary="${destination}/${basename}"
elif [ -L "${binary}" ]; then
echo "Destination binary is symlinked..."
dirname="$(dirname "${binary}")"
binary="${dirname}/$(readlink "${binary}")"
fi
# Strip invalid architectures so "fat" simulator / device frameworks work on device
if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
strip_invalid_archs "$binary"
fi
# Resign the code if required by the build settings to avoid unstable apps
code_sign_if_enabled "${destination}/$(basename "$1")"
# Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
local swift_runtime_libs
swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u)
for lib in $swift_runtime_libs; do
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
code_sign_if_enabled "${destination}/${lib}"
done
fi
}
# Copies and strips a vendored dSYM
install_dsym() {
local source="$1"
warn_missing_arch=${2:-true}
if [ -r "$source" ]; then
# Copy the dSYM into the targets temp dir.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}"
local basename
basename="$(basename -s .dSYM "$source")"
binary_name="$(ls "$source/Contents/Resources/DWARF")"
binary="${DERIVED_FILES_DIR}/${basename}.dSYM/Contents/Resources/DWARF/${binary_name}"
# Strip invalid architectures from the dSYM.
if [[ "$(file "$binary")" == *"Mach-O "*"dSYM companion"* ]]; then
strip_invalid_archs "$binary" "$warn_missing_arch"
fi
if [[ $STRIP_BINARY_RETVAL == 0 ]]; then
# Move the stripped file into its final destination.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.dSYM" "${DWARF_DSYM_FOLDER_PATH}"
else
# The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing.
mkdir -p "${DWARF_DSYM_FOLDER_PATH}"
touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.dSYM"
fi
fi
}
# Used as a return value for each invocation of `strip_invalid_archs` function.
STRIP_BINARY_RETVAL=0
# Strip invalid architectures
strip_invalid_archs() {
binary="$1"
warn_missing_arch=${2:-true}
# Get architectures for current target binary
binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)"
# Intersect them with the architectures we are building for
intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)"
# If there are no archs supported by this binary then warn the user
if [[ -z "$intersected_archs" ]]; then
if [[ "$warn_missing_arch" == "true" ]]; then
echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)."
fi
STRIP_BINARY_RETVAL=1
return
fi
stripped=""
for arch in $binary_archs; do
if ! [[ "${ARCHS}" == *"$arch"* ]]; then
# Strip non-valid architectures in-place
lipo -remove "$arch" -output "$binary" "$binary"
stripped="$stripped $arch"
fi
done
if [[ "$stripped" ]]; then
echo "Stripped $binary of architectures:$stripped"
fi
STRIP_BINARY_RETVAL=0
}
# Copies the bcsymbolmap files of a vendored framework
install_bcsymbolmap() {
local bcsymbolmap_path="$1"
local destination="${BUILT_PRODUCTS_DIR}"
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}"
}
# Signs a framework with the provided identity
code_sign_if_enabled() {
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
# Use the current code_sign_identity
echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'"
if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
code_sign_cmd="$code_sign_cmd &"
fi
echo "$code_sign_cmd"
eval "$code_sign_cmd"
fi
}
if [[ "$CONFIGURATION" == "Debug" ]]; then
install_framework "${PODS_XCFRAMEWORKS_BUILD_DIR}/Flipper-DoubleConversion/double-conversion.framework"
install_framework "${PODS_XCFRAMEWORKS_BUILD_DIR}/Flipper-Glog/glog.framework"
install_framework "${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL-Universal/OpenSSL.framework"
fi
if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
wait
fi
@kelset I'm also getting this issue and adding hermes.xcframework
to the Link Binary WIth Library build phase resolved it.
FWIW
System:
OS: macOS 12.5.1
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 3.33 GB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.9.0 - ~/.nvm/versions/node/v18.9.0/bin/node
Yarn: 1.22.11 - ~/.nvm/versions/node/v16.6.2/bin/yarn
npm: 8.19.1 - ~/.nvm/versions/node/v18.9.0/bin/npm
Watchman: Not Found
Managers:
CocoaPods: 1.11.3 - /Users/camerons/.gem/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0
Android SDK: Not Found
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8815526
Xcode: 14.0/14A309 - /usr/bin/xcodebuild
Languages:
Java: 11.0.15 - /Users/camerons/homebrew/opt/openjdk@11/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.1.0 => 18.1.0
react-native: 0.70.0 => 0.70.0
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
@cam-shaw it looks like you are using Xcode 14 and there's a separate issue currently open for that https://github.com/facebook/react-native/issues/34679
Hi everyone, I just tried to repro this without success.
What I noticed is that I already have these lines in my
if [[ "$CONFIGURATION" == "Debug" ]]; then
install_framework "${PODS_XCFRAMEWORKS_BUILD_DIR}/Flipper-DoubleConversion/double-conversion.framework"
install_framework "${PODS_XCFRAMEWORKS_BUILD_DIR}/Flipper-Glog/glog.framework"
install_framework "${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL-Universal/OpenSSL.framework"
install_framework "${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/hermes.framework"
fi
if [[ "$CONFIGURATION" == "Release" ]]; then
install_framework "${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/hermes.framework"
fi
in my Pods-testproject-frameworks.sh
script, that are the ones that fixes the issues, as suggested here.
After a quick search in the codebase, we don't add those lines in any script, therefore it is something Cocoapods does.
To me, it looks like a corrupted pod install
, either something happened and the error was silenced or there is some other misconfiguration going on.
I checked the Cocoapods version and we are both on 1.11.3
.
A few clarifying questions:
npx react-native init testproject && cd testproject && npx react-native run-ios
steps more than once?npx react-native init testproject --skip-install
cd testproject
yarn install
cd ios
bundle install
bundle exec pod install
Hi @cipolleschi, thank you. Tagging @kelset
First note, received an error when running bundle install
which I haven't seen before
Your Ruby version is 2.6.8, but your Gemfile specified 2.7.5
This also corresponds with the .ruby-version
2.7.5 - just to note this is not the default version or ruby for Mac OSX 12.5.1.
After updating ruby to 2.7.5, using the commands below did work with the inclusion of hermes.framework, the app compiled and ran fine.
bundle install
bundle exec pod install
However.. clearing ios/Pods and then using just pod install
does not work.
Also applied the above against my upgraded project 0.68.2 -> 0.70.0 and that now works as well with these commands..
Whats the next step to debug this ? reinstall cocoapods ?
Ok, so it seems that the problem is with the Ruby version and how the pod are installed. Thank you for the test.
The new setup that we are going to support is the one with Ruby 2.7.5
and bundler
. This will make it easier to handle the iOS dependencies in the long run.
note this is not the default version or ruby for Mac OSX 12.5.1.
Yes, we know. However, it is not a good practice to rely on the Mac OS default ruby version. There are plenty of articles online that explain why. Our suggestion is to install a Ruby version manager like RBEnv
and let it manage the dependencies for you.
Bundler is an helpful way to handle ruby dependencies and make sure that everyone have the same experience. Going forward, the suggested way to install the pods will always be by using bundle exec pod install
. Note that bundle install
has to run only once.
Whats the next step to debug this ? reinstall cocoapods ?
Sorry, I don't understand. What do you mean? What do you want to achieve with the "next steps"?
To improve the experience for everyone, we are going to:
bundle install
bundle exec pod install
Does this sound good?
That the default installation of a react project with npx react-native init testproject
fails but then running bundle exec pod install
does work so i figured this entire issue was about resolving this base installation issue..
What would be the next step in debugging this, as in, I helped with your questions and offering to try anything else for you since this issue is not been able to be replicated by some people
Thanks @cipolleschi and @kelset ..
I solved it by adding
hermes.xcframework
file to
xcode > build phases > Link binary with Libraries
section and rebuilding the app
it worked for me
anyone know which step i've missed?
@ddikodroid The problem you are facing is that React Native is using the system version while your folder is using something else. My suggestion would be to install a proper Ruby Version Manager as we suggest here. In the section: React Native CLI Quickstart/MacOS/iOS, we added some references to how to properly set up your ruby environment.
@ddikodroid The problem you are facing is that React Native is using the system version while your folder is using something else. My suggestion would be to install a proper Ruby Version Manager as we suggest here. In the section: React Native CLI Quickstart/MacOS/iOS, we added some references to how to properly set up your ruby environment.
i've installed rbenv, but still encountering that problem.
but, eventhough the error appears, i'm able to run the project succesfully but executing
bundle install
cd ios && bundle exec pod install
@ddikodroid Did you find a solution? I am facing the same issue. For new projects it works fine, but for these that are using RN < 0.70.x it doesn't.
@nikpetrovic can you share a screenshot with your error?
anyone know which step i've missed?
![]()
I was getting the same error as @ddikodroid until I installed new version of cocoapods via sudo gem install cocoapods
. Now i can init a brand new rn project, but when i try to run the old one:
after deleting node_modules and
npm install cd ios bundle install bundle exec pod install
I am getting:
any ideas @cipolleschi ?
@ddikodroid Did you find a solution? I am facing the same issue. For new projects it works fine, but for these that are using RN < 0.70.x it doesn't.
i'm using the workaround when i create a new project with react native version 0.67.2
After hours of investigation I finally figured out what was the problem. The first part is related to upgrading to react-native
0.70.x
and uprgading cocoapods via sudo gem install cocoapods
. I've also configured ruby version to 2.7.5
via rbenv
but not sure if this helped since I was getting the error even after upgrade. Only after sudo gem install cocoapods
it disappeared.
After this I was able to do pod install
but still getting the message Failed to load configuration of your project
. Than I found leftover in react-native.config.js
for the library I was not using anymore. After removing this configuration it started to work normally. Interestingly, I didn't get this error with 0.69.x although I didn't use this library as well. Hope someone will find this useful.
In case anyone needs a summary of this thread, this problem seems to be a result of version mismatches across a few possible places.
So, based on comments on this issue and other places, here are the steps I took to fix the error:
Gemfile
and .ruby-version
bundle install
bundle exec pod repo update
bundle exec pod install
I also made a blog post about it if you'd like more details: https://traviswimer.com/blog/cocoapods-could-not-find-compatible-versions-for-pod-hermes-engine/
If you're on an older version of React Native <0.67.0, it will not include a Gemfile
, so the process will be different (and may have some issues)
2.7.4
is the version initially used in RN 0.67.0
)gem install cocoapods
pod repo update
Podfile.lock
pod install
@traviswimer
Thanks.. For me it was also important to use
'bundle exec pod install'
@Gnative That's a good point, although I'm not sure to what extent its necessary. I suppose it would depend on what a project has in its Gemfile
(if it has one).
I'm not super knowledgable with Ruby, but I think using bundle exec
could also cause problems if, for example, the Gemfile included an older version of CocoaPods.
Any idea why bundle exec
was necessary in your case? Did you still get the same error with just pod install
or was it possibly a result of some other issue caused by not using the gem versions in your Gemfile
?
I may add a note about this to my post, but I'm not entirely sure what to say other than that bundle exec
may be necessary in certain cases.
@traviswimer - it's great you wrote this post and article.. thanks.
Following this comment above from @cipolleschi https://github.com/facebook/react-native/issues/34608#issuecomment-1246730507 where they say that the suggested way going forward is to use bundle install
and bundle exec pod install
You can read the corresponding thread above that comment between @cipolleschi and myself.
There is also this in the React Native documentation about using the Ruby Bundler - https://reactnative.dev/docs/environment-setup#bundler
I couldn't tell you why, for me, bundle exec
is necessary but hermes.framework
is not included in the project unless I run bundle exec pod install
.
Hi there! @traviswimer we decided to adopt bundle
for Ruby as a measure to avoid fragmentation in the various versions of ruby and cocoapods for all our users.
Thanks to the Gemfile
and the .ruby-version
file, we can ensure that all the users on a given React Native version are all using the same versions of the common dependencies. In this way, we would be able to support every user more efficiently and in a more scalable way.
bundle exec
will the the recommended way to install the dependencies for iOS. By using it, we can safely exclude a whole set of configuration problems. The newer version of the CLI will use bundler by default. And we have plans to upgrade the doctor
command with similar checks.
I hope this can shed more light on how we would like to handle dependencies and configurations from now on. The rationale is that it should simplify the management in the long run.
@cipolleschi @Gnative Thanks for the clarification.
My understanding from this is that the cli now creates a Gemfile
and .ruby-version
at the root of the project. When you upgrade the project's version of React Native, you will need to change the versions in these files. In other words, use the React Native Upgrade Helper to determine the necessary changes and then go through all the steps to upgrade Ruby, CocoaPods, and the actual pods.
Based on this, I believe my previous conclusions were not good advice. I have updated my original comment as well as my blog post.
If any of it still sounds incorrect/misleading, I appreciate your feedback.
Thanks again!
Hi guys.
Once you are migrating from previous RN version to latest one (for example RN v0.70+) you just need additionally run this in ios
folder:
pod update hermes-engine --no-repo-update
Sometimes pod install not installing the new hermes engine correctly. Once you done this, clean and rebuild project app is opening correctly.
If you run this command you can find this diff in Podfile.lock:
i updated from 0.70.0 to 0.70.6 and it works for me now
I have the same issue, in GitHub action macos-12.
I solved it by adding
hermes.xcframework
file to
xcode > build phases > Link binary with Libraries
section and rebuilding the app
This didn't work for us, in GitHub action macos-12 runner, still produce a bad build
We also use bundle
, bundle install
, cd ios && bundle exec pod install
, we also use ruby 2.7.5
, nothing we tried work.
React Native 0.68.5, any clue how we can do ?
@kopax-polyconseil I'm not sure if this is the problem, but the Gemfile
for 0.68.5
uses Ruby 2.7.4
:
https://raw.githubusercontent.com/react-native-community/rn-diff-purge/release/0.68.5/RnDiffApp/Gemfile
You might want to check your Gemfile
to ensure the Ruby and CocoaPods versions listed match the versions in the the official Gemfile for react native 0.68.5
.
Also, if you look at my previous comment, you'll see that you missed one step that needs to be run before installing pods:
bundle exec pod repo update
It may also have something to do with the hermes.xcframework
you added to Link binary with Libraries
. You may have added the wrong version. Also, in the latest versions of react native the Hermes framework is added automatically, but I can't remember if 0.68.5
is before or after this change was added.
If you decide to upgrade React Native to the latest version, you shouldn't include Hermes manually.
If you decide to upgrade React Native to the latest version, you shouldn't include Hermes manually.
We want to upgrade react native but it can't be done prior solving our e2e env, as the upgrade for us will take some time (we already had an attempt).
Also, if you look at my https://github.com/facebook/react-native/issues/34608#issuecomment-1319114711, you'll see that you missed one step that needs to be run before installing pods: bundle exec pod repo update
I tried it, I also tried to remove the Podfile.lock, I almost tried everything, you can see it here https://github.com/pass-culture/pass-culture-app-native/actions/workflows/e2e-ios-app.yml , because it takes 2 hours, I try a lot of thing per attempt to fix and none of them work.
This is the pull request I work on to try to fix: https://github.com/pass-culture/pass-culture-app-native/pull/3996
It may also have something to do with the hermes.xcframework you added to Link binary with Libraries
It was not in here, I tried to add it after reading this topic, it didn't helped, I then tried to do the second advice here: https://github.com/facebook/react-native/issues/34601#issuecomment-1239398489 , then it said:
❌ error: Multiple commands produce '/Users/runner/Library/Developer/Xcode/DerivedData/PassCulture-azrmecqxadxqrlcfhryqxqnufohv/Build/Products/Release-iphonesimulator/PassCulture.app/Frameworks/hermes.framework'
Since it got added twice and build failed, we only kept the second option, it also didn't work, but this time I don't have a bug report log like I had before (exemple here)
Also, I am not sure if it should work for our version. This problem we only have it in GitHub action, in Circle CI we do not have it, and locally also it work fine.
I also tried without success to:
pod update hermes-engine --no-repo-update
)maxim-lobanov/setup-xcode@v1
for both macos-11 and macos-12, it didn't helped.find / -name hermes
and create symlink to have it available, didn't helped.What else can I try ?
@kopax-polyconseil Since the problem is only on Github Actions, I'd probably look into whether it's caching anything from previous runs. If DerivedData
, your ios/build
folder, or node_modules
are persisting between builds, I imagine that has the potential to cause some problems.
I'm not all that knowledgable on Github Actions, but if its possible that caching is the issue, you could try creating another simpler action just to test if making a fresh build fixes the error.
you could try creating another simpler action just to test if making a fresh build fixes the error.
I already tried it and it didn't work. We will have to try to upgrade to React Native and pray :)
edit by @kelset: this issue is caused by the Ruby version installed. Please refer to this comment for steps to fix it.
I just wanted to try out the latest release from yesterday which is 0.70, but did not work at all as a default empty project
It's immediately crashing when i run it
Description
### Description `Translated Report (Full Report Below) ------------------------------------- Incident Identifier: B813BAD6-A8CA-4003-B965-6FE4733EC654 CrashReporter Key: 6FE47381-36D7-18B0-B222-F84F8B90D961 Hardware Model: MacBookPro16,1 Process: testproject [10096] Path: /Users/USER/Library/Developer/CoreSimulator/Devices/5ECF7949-51A1-4E17-B4CE-E7186750E864/data/Containers/Bundle/Application/5089FB61-ED38-4EA9-B58F-6395012D6D83/testproject.app/testproject Identifier: org.reactjs.native.example.testproject Version: 1.0 (1) Code Type: X86-64 (Native) Role: Foreground Parent Process: launchd_sim [7524] Coalition: com.apple.CoreSimulator.SimDevice.5ECF7949-51A1-4E17-B4CE-E7186750E864 [31205] Responsible Process: SimulatorTrampoline [3271] Date/Time: 2022-09-06 14:53:35.0726 +0300 Launch Time: 2022-09-06 14:53:35.0415 +0300 OS Version: macOS 12.5.1 (21G83) Release Type: User Report Version: 104 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Termination Reason: DYLD 1 Library missing Library not loaded: @rpath/hermes.framework/hermes Referenced from: /Users/USER/Library/Developer/CoreSimulator/Devices/5ECF7949-51A1-4E17-B4CE-E7186750E864/data/Containers/Bundle/Application/5089FB61-ED38-4EA9-B58F-6395012D6D83/testproject.app/testproject Reason: tried: '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/hermes.framework/hermes' (no such file), '/usr/lib/swift/hermes.framework/hermes' (no such file), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/hermes.framework/hermes' (no such file), '/usr/lib/swift/hermes.framework/hermes' (no such file), '/Users/bayram/Library/Developer/CoreSimulator/Devices/5ECF7949-51A1-4E17-B4CE-E7186750E864/data/Containers/Bundle/Application/5089FB61-ED38-4EA9-B58F-6395012D6D83/testproject.app/Frame (terminated at launch; ignore backtrace) Triggered by Thread: 0 Thread 0 Crashed: 0 dyld 0x11192298e __abort_with_payload + 10 1 dyld 0x111938a72 abort_with_payload_wrapper_internal + 80 2 dyld 0x111938aa4 abort_with_payload + 9 3 dyld_sim 0x10d0108eb abort_with_payload + 26 4 dyld_sim 0x10cfd04eb dyld4::halt(char const*) + 375 5 dyld_sim 0x10cfccc1c dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 3070 6 dyld_sim 0x10cfcce42 _dyld_sim_prepare + 379 7 dyld 0x1118e2b78 dyld4::prepareSim(dyld4::RuntimeState&, char const*) + 1265 8 dyld 0x1118e170e dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 244 9 dyld 0x1118e14e4 start + 388 Thread 0 crashed with X86 Thread State (64-bit): rax: 0x0000000002000209 rbx: 0x0000000000000000 rcx: 0x00007ff7b6201378 rdx: 0x00007ff7b62017f0 rdi: 0x0000000000000006 rsi: 0x0000000000000001 rbp: 0x00007ff7b62013c0 rsp: 0x00007ff7b6201378 r8: 0x00007ff7b62013f0 r9: 0x0000000000000000 r10: 0x00000000000000f2 r11: 0x0000000000000246 r12: 0x00000000000000f2 r13: 0x00007ff7b62017f0 r14: 0x0000000000000001 r15: 0x0000000000000006 rip: 0x000000011192298e rfl: 0x0000000000000246 cr2: 0x000000010cfd2936 Logical CPU: 0 Error Code: 0x02000209 Trap Number: 133 Binary Images: 0x1118dc000 - 0x111947fff dyld (*)Version
0.70
Output of
npx react-native info
Steps to reproduce
just run
npx react-native init testproject
thencd testproject && npx react-native run-ios
Snack, code example, screenshot, or link to a repository
https://user-images.githubusercontent.com/44513402/188628441-e57b8824-ac03-4fe7-9b5e-2ed07a6e3ca1.mp4