gpt4 book ai didi

javascript - hermes 在 react-native 0.60.5 的发布版本中有错误

转载 作者:行者123 更新时间:2023-11-29 10:26:37 24 4
gpt4 key购买 nike

我将我的 react-native 项目从 0.59.4 升级到 0.60.5,一切正常。我尝试在没有 Hermes 的情况下进行发布构建,一切正常,但是当我在 android/app/build.gradle 中启用 Hermes 选项并尝试进行发布构建时,出现如下错误:

a busy cat

如何解决这个问题并为我的项目启用Hermes?

最佳答案

首先,尝试清理 node_modules 并通过 yarn 再次安装。

此问题已在 this PR 中修复.

您也可以通过将 android/app/build.gradle 更改为:

来修复它:
project.ext.react = [
...
hermesCommand: "../../node_modules/hermesvm/%OS-BIN%/hermes",
...
]

更新

首先通过以下方式添加新的爱马仕:

yarn add --dev hermes-engine@0.1.1

然后在 android/app/build.gradle 中:

project.ext.react = [
entryFile: "index.js",
enableHermes: true, // clean and rebuild if changing
hermesCommand: "../../node_modules/hermes-engine/%OS-BIN%/hermes",
]

同时改变这个:

def hermesPath = "../../node_modules/hermesvm/android/";

为此:

def hermesPath = "../../node_modules/hermes-engine/android/";

然后将 node_module/react-native/react.gradle 替换为 this file .

如果您使用 Proguard/R8,请将此添加到 android/app/proguard-rules.pro:

-keep class com.facebook.hermes.unicode.* { *; }

然后通过 gradlew clean 清理,最后:

gradlew assembleRelease

关于javascript - hermes 在 react-native 0.60.5 的发布版本中有错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57544334/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com