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

0.76: undefined function when using a swift App Delegate (iOS) #48635

Open
fbp93 opened this issue Jan 13, 2025 · 1 comment
Open

0.76: undefined function when using a swift App Delegate (iOS) #48635

fbp93 opened this issue Jan 13, 2025 · 1 comment
Labels

Comments

@fbp93
Copy link

fbp93 commented Jan 13, 2025

Description

Since RN 0.76 many packages that use iOS native code started to break at runtime with the error <function> is not a function (it is undefined). For example using [this localization package ](https://github.com/zoontek/react-native-localize) I get _NativeRNLocalize.default.getTimeZone is not a function (it is undefined)`.
I tried on a sample project and everything seems working fine if I use the objective c AppDelegate, but break when I use a Swift AppDelegate.
Everything was working fine up to 0.75.x, even if the swift AppDelegate.
Am I missing something during the swift setup with the new architecture?

Steps to reproduce

  1. Install the app
  2. See the runtime error

React Native Version

0.76.6

Affected Platforms

Runtime - iOS

Output of npx react-native info

System:
  OS: macOS 14.6.1
  CPU: (10) arm64 Apple M1 Pro
  Memory: 67.94 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.12.1
    path: ~/Library/Caches/fnm_multishells/33282_1736765257085/bin/node
  Yarn:
    version: 1.22.19
    path: /usr/local/bin/yarn
  npm:
    version: 8.19.2
    path: ~/Library/Caches/fnm_multishells/33282_1736765257085/bin/npm
  Watchman:
    version: 2024.11.18.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods: Not Found
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.0
      - iOS 18.0
      - macOS 15.0
      - tvOS 18.0
      - visionOS 2.0
      - watchOS 11.0
  Android SDK:
    API Levels:
      - "23"
      - "28"
      - "29"
      - "30"
      - "31"
      - "33"
      - "34"
      - "35"
    Build Tools:
      - 30.0.3
      - 31.0.0
      - 33.0.0
      - 33.0.1
      - 34.0.0
      - 35.0.0
    System Images:
      - android-28 | Google ARM64-V8a Play ARM 64 v8a
      - android-34 | Google APIs ARM 64 v8a
      - android-34 | Google Play ARM 64 v8a
    Android NDK: 25.1.8937393
IDEs:
  Android Studio: 2022.3 AI-223.8836.35.2231.10671973
  Xcode:
    version: 16.0/16A242
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.13
    path: /opt/homebrew/Cellar/openjdk@17/17.0.13/bin/javac
  Ruby:
    version: 3.0.0
    path: /Users/work/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react: Not Found
  react-native: Not Found
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

(node:38123) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

Stacktrace or Logs

Warning: TypeError: _NativeRNLocalize.default.getTimeZone is not a function (it is undefined)

This error is located at:
    in App
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in ReproducerApp(RootComponent), js engine: hermes

Reproducer

https://github.com/fbp93/RN-0.76

Screenshots and Videos

No response

@fbp93
Copy link
Author

fbp93 commented Jan 13, 2025

@cipolleschi 🙏

@react-native-bot react-native-bot added the Platform: iOS iOS applications. label Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants