-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
React Native requires XCode >= 14.3. Found 14.2 #44384
Comments
|
The error is self explanatory: you need to update XCode version. |
The problem is xcode 14.3 requires MacOS 13.3, my current macbook (MacBook Pro (Retina, 15-inch, Mid 2015)) only offers an update to MacOS 12.7.4. |
The same issue exactly is there any solution for this?
The same issue exactly. Is there a solution? |
Nope sorry. Those limitations are imposed by Apple and outside our control |
I have same issue: Device: MacBook Pro (Retina, 15-inch, Mid 2015). There is a problem when we open projects or pod install. |
I fixed my problem with making new project with; npx react-native init App01 --version 0.71.7 I hope this helps. |
It also worked for me once I downgraded react-native to 0.71.7 |
how to show this issue my xcode version 14.1 i couldn't install 14.3 xcode version is helps |
We couldn't install xCode 14.3 so this helped us. |
Hello , solution provided is buy a new MacBook but sometimes this is not too easy and many of us we want to develop in this case the Max solution from apple is use Xcode 14.2 and here RN we have to guess it because is not a version I can use ? |
npx react-native init App01 --version 0.71.7 it works for me thanks |
Version 0.73.7 also works. I think it is the last version before deprecating XCode 14.2. IMO, the rationale for removing support for XCode 14.2 is not sufficient. MacOS Monterey will no longer be compatible with recent React Native versions and that also means any MacBook Pro released before 2017. See the commit message: 1021448 If you don't mind the "cryptic error", you can bypass this by changing the Bit-casting object representations feature is also used in Yoga which requires Xcode 14.3 or later. You can write you own // node_modules/react-native/ReactCommon/yoga/yoga/style/StyleValuePool.h /*
* 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.
*/
#pragma once
#include <cassert>
#include <cstdint>
+ #include <cstring> // For std::memcpy
#include <yoga/numeric/FloatOptional.h>
#include <yoga/style/SmallValueBuffer.h>
#include <yoga/style/StyleLength.h>
#include <yoga/style/StyleValueHandle.h>
namespace facebook::yoga {
+ template <typename To, typename From>
+ To bit_cast(const From& src) noexcept {
+ static_assert(sizeof(To) == sizeof(From), "Size mismatch in bit_cast");
+ static_assert(std::is_trivially_copyable<From>::value, "Source type must be trivially copyable");
+ static_assert(std::is_trivially_copyable<To>::value, "Destination type must be trivially copyable");
+ To dst;
+ std::memcpy(&dst, &src, sizeof(To));
+ return dst;
+ }
+
/**
* StyleValuePool allows compact storage for a sparse collection of assigned
* lengths and numbers. Values are referred to using StyleValueHandle. In most
* cases StyleValueHandle can embed the value directly, but if not, the value is
* stored within a buffer provided by the pool. The pool contains a fixed number
* of inline slots before falling back to heap allocating additional slots.
*/
class StyleValuePool {
public:
void store(StyleValueHandle& handle, StyleLength length) {
if (length.isUndefined()) {
handle.setType(StyleValueHandle::Type::Undefined);
} else if (length.isAuto()) {
handle.setType(StyleValueHandle::Type::Auto);
} else {
auto type = length.unit() == Unit::Point
? StyleValueHandle::Type::Point
: StyleValueHandle::Type::Percent;
storeValue(handle, length.value().unwrap(), type);
}
}
void store(StyleValueHandle& handle, FloatOptional number) {
if (number.isUndefined()) {
handle.setType(StyleValueHandle::Type::Undefined);
} else {
storeValue(handle, number.unwrap(), StyleValueHandle::Type::Number);
}
}
StyleLength getLength(StyleValueHandle handle) const {
if (handle.isUndefined()) {
return value::undefined();
} else if (handle.isAuto()) {
return value::ofAuto();
} else {
assert(
handle.type() == StyleValueHandle::Type::Point ||
handle.type() == StyleValueHandle::Type::Percent);
float value = (handle.isValueIndexed())
- ? std::bit_cast<float>(buffer_.get32(handle.value()))
+ ? bit_cast<float>(buffer_.get32(handle.value()))
: unpackInlineInteger(handle.value());
return handle.type() == StyleValueHandle::Type::Point
? value::points(value)
: value::percent(value);
}
}
FloatOptional getNumber(StyleValueHandle handle) const {
if (handle.isUndefined()) {
return FloatOptional{};
} else {
assert(handle.type() == StyleValueHandle::Type::Number);
float value = (handle.isValueIndexed())
- ? std::bit_cast<float>(buffer_.get32(handle.value()))
+ ? bit_cast<float>(buffer_.get32(handle.value()))
: unpackInlineInteger(handle.value());
return FloatOptional{value};
}
}
private:
void storeValue(
StyleValueHandle& handle,
float value,
StyleValueHandle::Type type) {
handle.setType(type);
if (handle.isValueIndexed()) {
auto newIndex =
- buffer_.replace(handle.value(), std::bit_cast<uint32_t>(value));
+ buffer_.replace(handle.value(), bit_cast<uint32_t>(value));
handle.setValue(newIndex);
} else if (isIntegerPackable(value)) {
handle.setValue(packInlineInteger(value));
} else {
- auto newIndex = buffer_.push(std::bit_cast<uint32_t>(value));
+ auto newIndex = buffer_.push(bit_cast<uint32_t>(value));
handle.setValue(newIndex);
handle.setValueIsIndexed();
}
}
static constexpr bool isIntegerPackable(float f) {
constexpr uint16_t kMaxInlineAbsValue = (1 << 11) - 1;
int32_t i = static_cast<int32_t>(f);
return static_cast<float>(i) == f && i >= -kMaxInlineAbsValue &&
i <= +kMaxInlineAbsValue;
}
static constexpr uint16_t packInlineInteger(float value) {
uint16_t isNegative = value < 0 ? 1 : 0;
return static_cast<uint16_t>(
(isNegative << 11) |
(static_cast<int32_t>(value) * (isNegative ? -1 : 1)));
}
static constexpr float unpackInlineInteger(uint16_t value) {
constexpr uint16_t kValueSignMask = 0b0000'1000'0000'0000;
constexpr uint16_t kValueMagnitudeMask = 0b0000'0111'1111'1111;
const bool isNegative = (value & kValueSignMask) != 0;
return static_cast<float>(
(value & kValueMagnitudeMask) * (isNegative ? -1 : 1));
}
SmallValueBuffer<4> buffer_;
};
} // namespace facebook::yoga
PS; The fix was tested on RN 0.74.5. I also had to rollback the updates to LaunchScreen.storyboard file. |
Summary: Pull Request resolved: #43583 Fail during `pod install` if user's version of XCode is too old to avoid cryptic errors (e.g. reactwg/react-native-releases#163). I reused existing mechanism for version detection, though it may not be reliable for future versions of XCode. Changelog: [iOS][Changed] - Warn users during "pod install" if XCode is too old Reviewed By: dmytrorykun Differential Revision: D55149636 fbshipit-source-id: 78387ff19a6eb10f3ca0d4aa78e6b934ae3b0711
the saving grace is a fix called open-core patcher, yes perhaps you dont want to upgrade your macbook but want the latest os and do this and do that, Yes you can with Open-core patcher you can run the latest mac os on that old system it works even for Mac OS 10 and so on .so give it a shot , you can send me a tip and follow me as well if you liked this |
Description
Initialising a new project and running
pod install
throws this errorSteps to reproduce
React Native Version
0.74.0
Affected Platforms
Runtime - Android, Runtime - iOS
Areas
Bridgeless - The New Initialization Flow
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/shahjahanpak/AwesomeProject
Screenshots and Videos
The text was updated successfully, but these errors were encountered: