【问题标题】:React Native iOS - Hermes is enabled in Podfile, but isn't enabled in appReact Native iOS - 在 Podfile 中启用 Hermes,但在应用程序中未启用
【发布时间】:2021-10-31 07:05:19
【问题描述】:

我正在尝试在我的适用于 iOS 的 React Native 0.65 应用程序中启用 Hermes。我已按照文档通过对我的 Podfile 进行此更改来启用 Hermes:

use_react_native!(
     :path => config[:reactNativePath],
     # to enable hermes on iOS, change `false` to `true` and then install pods
-    :hermes_enabled => false
+    :hermes_enabled => true
   )

然后我清理了构建文件夹,运行 pod install,并在调试模式下为物理 iOS 设备重建了我的应用程序。但是,在我的应用程序中运行 React Native 提供的以下代码表明 Hermes 实际上已被禁用:

const isHermes = () => !!global.HermesInternal; // <-- returns false

如何在我的应用中启用 Hermes?我正在运行 React Native 0.65.1,最近从 0.64.2 升级。谢谢。

【问题讨论】:

    标签: javascript ios react-native cocoapods react-native-hermes


    【解决方案1】:

    您是否检查了undefined 值。输入!! 将评估为布尔值。

    【讨论】:

      猜你喜欢
      • 2022-10-23
      • 2022-01-20
      • 2018-03-28
      • 2017-05-04
      • 1970-01-01
      • 2022-12-24
      • 2023-01-21
      • 2019-08-07
      • 1970-01-01
      相关资源
      最近更新 更多