React Native Flipper:Flipper爱马仕调试器未显示

zynd9foi  于 2023-01-14  发布在  React
关注(0)|答案(3)|浏览(309)

翻板Hermes debugger未显示
我想问一下怎么样才能让他正常发挥?
本地React:0.62.2(从0.61更新为0.62.2)
https://fbflipper.com/
https://reactnative.dev/docs/hermes
错误消息:

Metro is connected but no Hermes apps were found.

Open a React Native screen with Hermes enabled to connect. Note: you may need to reload the app in order to reconnect the device to Metro.

kognpnkq

kognpnkq1#

在android/app/build.gradle文件中执行此操作

project.ext.react = [
  entryFile: "index.js",
  enableHermes: true 
]

这个在proguard-rules.pro文件中

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

还有
$ cd安卓系统&& ./gradlew清洁
对我有用

6psbrbz9

6psbrbz92#

在我的情况下,显示https://github.com/facebook/flipper/issues/1520中提到的屏幕
我发现这是由于公司VPN发生的。每当我必须调试时,我就断开vpn,它工作正常。

46scxncf

46scxncf3#

在android/app/ www.example.com中更改以下配置gradle.properties对我很有效。

expo.jsEngine=hermes

然后CD android && ./gradlew clean
您还可以通过将以下代码段添加到App.js或react native中的任何其他.js文件来验证是否启用了爱马仕。

const isHermes = () => !!global.HermesInternal;
 console.log("Is Hermes enabled " + isHermes())

相关问题