簡體   English   中英

無法使用 debugger-ui 調試 react-native 應用程序

[英]Unable to debug react-native app using debugger-ui

可能這個查詢早就解決了,但我找不到解決方案

嘗試在http://localhost:8081/debugger-ui/的幫助下調試 react-native 應用程序。 為此,我在 android 模擬器中部署了應用程序,單擊ctrl + m | 選擇了Debug選項,但最終出現以下錯誤

Invariant Violation: Calling synchronous methods on native modules is not supported in Chrome, Consider providing alternative methods to expose this method in debug mode, e.g. by exposing constants ahead-of-time, Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)

在此處輸入圖像描述

為了解決這個問題,我經歷了link1link2link3link4但無法解決。 任何人都可以在這方面提供幫助。

警告:僅用於調試(不依賴於 DeviceInfo)

調查后,在整個項目中搜索react-native-device-info導入並在兩個地方找到並像這樣初始化

const uniqueId = DeviceInfo.getUniqueIdSync();
const appVersion = DeviceInfo.getVersionSync();

評論了這兩行並分配了一些虛擬值,例如

const uniqueId = `device`;
const appVersion = `device`;

然后能夠調試應用程序

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM