开启Hermes后React Native应用白屏怎么办?
我刚在React Native项目里启用了Hermes引擎,结果iOS模拟器一运行就白屏,控制台也没报错。之前用JSC完全正常,是不是哪里配置漏了?
我试过clean build folder、重装node_modules,甚至新建了一个最小组件测试,还是白屏。下面是那个测试组件的代码:
import React from 'react';
import { View, Text } from 'react-native';
const App = () => {
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text>Hermes Test</Text>
</View>
);
};
export default App;
Mr.佳宜
Lv1
试试这个 在ios/Podfile里加一行 pod 'hermes-engine', :path => '../node_modules/hermes-engine' 然后重新pod install
点赞
2026-03-20 18:00