【发布时间】:2019-11-27 08:37:54
【问题描述】:
我已将现有(非新)项目中的 React-native 升级到 0.60.2,方法是更改 package.json,如此处所述https://react-native-community.github.io/upgrade-helper/?from=0.59.10&to=0.60.2
在 android/app/build.gradle 我放: p
roject.ext.react = [
entryFile: "index.js",
enableHermes: true // clean and rebuild if changing
]
构建成功,但 Hermes 似乎不起作用,在 RN 0.59.0 中,apk 为 29 Mb,现在为 46 Mb。
如果我像这里 https://react-native-community.github.io/upgrade-helper/?from=0.59.10&to=0.60.2 那样向 build.gradle 添加其他更改
然后我得到错误: 无法读取脚本“/Users/mac/Desktop/aqua2/node_modules/@react-native-community/cli-platform-android/native_modules.gradle”,因为它不存在。
可能是因为最后一行:
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
我该如何解决这个问题?
【问题讨论】:
-
@yevgen-pashutin 你找到解决方案了吗?我在一个新项目中面临同样的问题。
global.HermesInternal好像是undefined -
我也收到了
undefined,并按照build.graddle的所有说明进行操作
标签: android react-native