software-mansion / react-native-reanimated

React Native's Animated library reimplemented
https://docs.swmansion.com/react-native-reanimated/
MIT License
8.87k stars 1.29k forks source link

Can't build ios with XCode 15.3 after update #5959

Open mrigo opened 5 months ago

mrigo commented 5 months ago

Description

I've updated to XCode 15.3 and now I can't build my app anymore. I have got this error

ld: warning: Could not find or use auto-linked framework 'CoreAudioTypes': framework 'CoreAudioTypes' not found
Undefined symbols for architecture arm64:
  "facebook::hermes::inspector_modern::chrome::enableDebugging(std::__1::unique_ptr<facebook::hermes::inspector_modern::RuntimeAdapter, std::__1::default_delete<facebook::hermes::inspector_modern::RuntimeAdapter>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&)", referenced from:
      reanimated::ReanimatedHermesRuntime::ReanimatedHermesRuntime(std::__1::unique_ptr<facebook::hermes::HermesRuntime, std::__1::default_delete<facebook::hermes::HermesRuntime>>, std::__1::shared_ptr<facebook::react::MessageQueueThread> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) in libRNReanimated-tvOS.a[29](ReanimatedHermesRuntime.o)
  "facebook::hermes::inspector_modern::chrome::disableDebugging(int)", referenced from:
      reanimated::ReanimatedHermesRuntime::~ReanimatedHermesRuntime() in libRNReanimated-tvOS.a[29](ReanimatedHermesRuntime.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This is my package.json

{
  "name": "UFairTV",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "expo run:android",
    "ios": "expo run:ios",
    "tvos": "expo run:ios --scheme UFairTV-tvOS --device \"Apple TV\"",
    "lint": "eslint .",
    "start": "expo start",
    "test": "jest"
  },
  "dependencies": {
    "@expo/metro-runtime": "^3.1.3",
    "@expo/webpack-config": "^19.0.1",
    "@hookform/resolvers": "^3.3.4",
    "@react-native-community/hooks": "^3.0.0",
    "@react-navigation/bottom-tabs": "^6.5.11",
    "@react-navigation/drawer": "^6.6.6",
    "@react-navigation/native": "^6.1.7",
    "@react-navigation/native-stack": "^6.9.13",
    "@react-navigation/stack": "^6.3.20",
    "axios": "^1.6.0",
    "dayjs": "^1.11.10",
    "expo": "^50.0.17",
    "expo-linear-gradient": "~12.3.0",
    "expo-modules-core": "^1.11.13",
    "expo-screen-orientation": "~6.0.6",
    "lodash": "^4.17.21",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-hook-form": "^7.49.3",
    "react-native": "npm:react-native-tvos@latest",
    "react-native-default-preference": "^1.4.4",
    "react-native-device-info": "^10.12.0",
    "react-native-gesture-handler": "~2.12.0",
    "react-native-linear-gradient": "^2.8.3",
    "react-native-localization": "^2.3.2",
    "r": "^3.9.0",
    "react-native-reanimated-carousel": "^3.5.1",
    "react-native-safe-area-context": "^4.7.2",
    "react-native-screens": "^3.31.1",
    "react-native-svg": "13.9.0",
    "react-native-video": "^5.2.1",
    "styled-components": "^6.0.8",
    "yup": "^1.3.3"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@babel/preset-env": "^7.20.0",
    "@babel/runtime": "^7.20.0",
    "@react-native/babel-preset": "^0.74.81",
    "@react-native/eslint-config": "^0.74.81",
    "@react-native/metro-config": "^0.74.81",
    "@tsconfig/react-native": "^3.0.0",
    "@types/react": "^18.0.24",
    "@types/react-native-video": "^5.0.19",
    "@types/react-test-renderer": "^18.0.0",
    "babel-jest": "^29.2.1",
    "babel-plugin-styled-components": "^2.1.4",
    "eslint": "^8.19.0",
    "jest": "^29.2.1",
    "metro-react-native-babel-preset": "0.76.8",
    "prettier": "^2.4.1",
    "react-native-svg-transformer": "^1.3.0",
    "react-test-renderer": "18.2.0",
    "typescript": "4.8.4"
  },
  "engines": {
    "node": ">=16"
  }
}

And this is my Podfile

source 'https://github.com/react-native-tvos/react-native-tvos-podspecs.git'
source 'https://cdn.cocoapods.org/'

# Resolve react_native_pods.rb with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
  'require.resolve(
    "react-native/scripts/react_native_pods.rb",
    {paths: [process.argv[1]]},
  )', __dir__]).strip

prepare_react_native_project!

linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
  Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
  use_frameworks! :linkage => linkage.to_sym
end

target 'UFairTV' do
  config = use_native_modules!
  platform :ios, min_ios_version_supported

  # Flags change depending on the env values.
  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],
    # Hermes is now enabled by default. Disable by setting this flag to false.
    :hermes_enabled => flags[:hermes_enabled],
    :fabric_enabled => flags[:fabric_enabled],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  target 'UFairTVTests' do
    inherit! :complete
    # Pods for testing
  end

end

target 'UFairTV-tvOS' do
  config = use_native_modules!
  platform :tvos, min_ios_version_supported

  # Flags change depending on the env values.
  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],
    # Hermes is now enabled by default. Disable by setting this flag to false.
    :hermes_enabled => flags[:hermes_enabled],
    :fabric_enabled => flags[:fabric_enabled],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  target 'UFairTV-tvOSTests' do
    inherit! :complete
    # Pods for testing
  end

end

post_install do |installer|
  config = use_native_modules!
  # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
  react_native_post_install(
    installer,
    config[:reactNativePath],
    :mac_catalyst_enabled => false
  )
  # __apply_Xcode_12_5_M1_post_install_workaround(installer)
end

This is my babel.config.js

module.exports = {
  presets: ['module:metro-react-native-babel-preset'],
  plugins: ['react-native-reanimated/plugin'],
};

I've tried to remove Hermes but it doesn't work.

I've been stuck for three days on this! I can't find anything anywhere! What could I do?

Thanks a lot to all of you

Steps to reproduce

  1. update xcode
  2. install react-native-reanimated
  3. build on xcode

Snack or a link to a repository

https://github.com/UFairTV/UFairTVApp

Reanimated version

3.9.0

React Native version

0.73.2

Platforms

iOS

JavaScript runtime

Hermes

Workflow

Expo Dev Client

Architecture

Fabric (New Architecture)

Build type

Debug app & dev bundle

Device

iOS simulator

Device model

No response

Acknowledgements

Yes

github-actions[bot] commented 5 months ago

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

dionisio28 commented 5 months ago

@mrigo I'm facing the same issue, did you find any solution?

mrigo commented 5 months ago

Hey, unfortunately no.. I recreate the entire project from a new one created with the expo cli…

tomekzaw commented 4 months ago

Here's a similar issue in react-native repo: https://github.com/facebook/react-native/issues/43498

@mrigo You might want to upgrade to latest version of react-native-tvos and see if it helps.

gibo77 commented 4 months ago

I have almost same issue. I upgraded Xcode, RN 0.74 and Reanimated to 3.10 and it will not build. I deleted Podfile.lock file. Run pod install. if Podfile.lock not created, run pod install again in iOS folder always. Then after that I was able to build.

machiapply commented 4 months ago

I have almost same issue. I upgraded Xcode, RN 0.74 and Reanimated to 3.10 and it will not build. I deleted Podfile.lock file. Run pod install. if Podfile.lock not created, run pod install again in iOS folder always. Then after that I was able to build.

this didn't work for me, still getting the exact same error on Xcode 15.3 (RN 0.73.0, Reanimated 3.8). oddly, I don't get it on Xcode 15.2, which our App Center is using to build.

mrbrentkelly commented 4 months ago

Getting the same issue with react-native-tvos@0.73.7-1 and reanimated@3.8.1.

Working around it for now by setting HERMES_ENABLE_DEBUGGER to 0 in the Reanimated podspec as suggested here.

ydvnishant001 commented 3 months ago

I think commenting the enableDebugging and disableDebugging option in "node_modules>react-native-reanimated>Common>cpp>ReanimatedRuntime>ReanimatedHermesRuntime.cpp" is ideal. SInce React Native has deprecated Remote JavaScript Debugging.

I can no longer see the option in Android dev-menu to remote debug. And the above methods are shown in dev-menu for ios earlier but now are deprecated but still being used by reanimated(I assume). So commenting them makes the build run successfully.

If anyone wants to use remote debugging they can follow this official guide - https://reactnative.dev/docs/next/other-debugging-methods. Which works on both ios and android.

szydlovsky commented 3 months ago

Hey @mrigo ! I believe everything runs smoothly now with newest Reanimated versions (3.12.0 - 3.12.1) and Xcode 15.4. Is there anything that makes you use Xcode 15.3 or is it okay for you to bump up?

gibo77 commented 3 months ago

Mine worked after doing upgrading to latest version everything and do fresh start. Like make new directory and rn init. You only need to copy your program source code. My package. Json is new as well by npm install each dependency.  This is the norm now if you can’t fix a week long set up  issues due to upgrading or adding broken dependency.  Sent from Yahoo Mail for iPhone

On Friday, June 28, 2024, 10:08 AM, Mikołaj Szydłowski @.***> wrote:

Hey @mrigo ! I believe everything runs smoothly now with newest Reanimated versions (3.12.0 - 3.12.1) and Xcode 15.4. Is there anything that makes you use Xcode 15.3 or is it okay for you to bump up?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>