又踩了个坑
升级了一下react-native 版本到0.71.2。结果在ios模拟器上运行时发现debugger不工作
控制台报错
info Opening flipper://null/Hermesdebuggerrn?device=React%20Native...
error Browser exited with error:, Error: invalid url, missing http/https protocol
按照错误理解了下,问题应该是flipper打开失败导致的问题
去翻了一下react-native issue 和 filpper 的issue,总结了一下
-
是因为单击“打开调试器”会默认打开flipper应用程序。
打开
Opening flipper://null/Hermesdebuggerrn?device=React%20Native...路径时,打开失败,然后报错 -
react-native 从 Hermes engine 从 0.70 开始默认开启
找到的解决方案
1、选择使用filpper作为调试工具,放弃掉react-native-debugger,打开就可以使用
2、降低react-native 版本到0.69,就可以正常使用
3、修改ios podfile 文件
:hermes_enabled => flags[:hermes_enabled],
//replace
:hermes_enabled => false,
个人使用filpper解决了这个问题,希望官方新版本能修复这个问题