如何继续调试反应本机应用程序?
How to proceed to debug a react native app?
我的 React 本机应用程序遇到问题,我不知道如何继续调试它。
我花了我的时间来修复之间的不匹配:我正在使用的包的不同版本,不同的 upgrades/updates(包,react native,Android Studio 等),依赖项更多比实际编码或更正我的代码。
这真的很令人沮丧,我觉得我做错了或者因为这类问题而陷入困境。
这里是关于我当前问题的信息:
我有 消息构建 Gradle:
logcat:
--------- beginning of system
08-02 14:10:03.784 758-793/? E/BatteryStatsService: no controller energy info supplied
08-02 14:10:03.784 758-793/? E/BatteryStatsService: no controller energy info supplied
08-02 14:10:03.813 758-793/? E/BatteryStatsService: modem info is invalid: ModemActivityInfo{ mTimestamp=0 mSleepTimeMs=0 mIdleTimeMs=0 mTxTimeMs[]=[0, 0, 0, 0, 0] mRxTimeMs=0 mEnergyUsed=0}
08-02 14:12:03.754 758-793/? E/BatteryStatsService: no controller energy info supplied
08-02 14:12:03.754 758-793/? E/BatteryStatsService: no controller energy info supplied
08-02 14:12:03.796 758-793/? E/BatteryStatsService: modem info is invalid: ModemActivityInfo{ mTimestamp=0 mSleepTimeMs=0 mIdleTimeMs=0 mTxTimeMs[]=[0, 0, 0, 0, 0] mRxTimeMs=0 mEnergyUsed=0}
08-02 14:12:13.757 758-793/? E/BatteryStatsService: no controller energy info supplied
08-02 14:12:13.758 758-793/? E/BatteryStatsService: no controller energy info supplied
08-02 14:12:13.800 758-793/? E/BatteryStatsService: modem info is invalid: ModemActivityInfo{ mTimestamp=0 mSleepTimeMs=0 mIdleTimeMs=0 mTxTimeMs[]=[0, 0, 0, 0, 0] mRxTimeMs=0 mEnergyUsed=0}
08-02 14:34:43.308 249-396/? E/qepo: is_quarter_epo_valid: Read QEPO file failed
08-02 14:34:43.328 249-396/? E/qepo: is_quarter_epo_valid: Read QEPO file failed
08-02 14:34:43.347 249-396/? E/qepo: is_quarter_epo_valid: Read QEPO file failed
08-02 14:34:43.947 237-329/? E/agps: [agps] ERR: [AGPS] update_imsi_to_supl_swip IMSI is invalid
08-02 14:34:43.979 237-344/? E/agps: [agps] ERR: [SUPL_CONN_ADP] is_socket_valid socket_fds[s]=-1 is invalid
08-02 14:34:43.980 237-344/? E/agps: [agps] ERR: [SUPL_CONN_ADP] soc_close s=0 is invalid
08-02 14:34:45.481 758-7252/? E/Sensors: handleToDriver handle(0)
08-02 14:34:45.481 758-7252/? E/Sensors: new setDelay handle(0),ns(66667000)m, error(0), index(2)
08-02 14:34:52.228 249-395/? E/epo: mtk_gps_epo_file_update: Update EPOHAL.DAT error
08-02 14:34:58.495 14056-14056/? E/PQ: [PQ][PQWhiteList] libwlparser.so is absent
08-02 14:35:02.268 249-395/? E/epo: mtk_gps_epo_file_update: Update EPOHAL.DAT error
08-02 14:35:04.818 249-396/? E/qepo: is_quarter_epo_valid: Read QEPO file failed
08-02 14:35:04.819 249-405/? E/MNLD: fsm_gps_state_started: fsm_gps_state_started() data1=1,data2=0,data3=0x0
08-02 14:35:04.819 249-405/? E/MNLD: fsm_gps_state_started: fsm_gps_state_stopping() unexpected event=3
08-02 14:35:04.846 249-396/? E/qepo: is_quarter_epo_valid: Read QEPO file failed
08-02 14:35:04.890 249-396/? E/qepo: is_quarter_epo_valid: Read QEPO file failed
08-02 14:35:04.928 249-396/? E/qepo: is_quarter_epo_valid: Read QEPO file failed
08-02 14:35:04.957 249-396/? E/qepo: is_quarter_epo_valid: Read QEPO file failed
08-02 14:35:04.996 249-396/? E/qepo: is_quarter_epo_valid: Read QEPO file failed
08-02 14:35:05.026 249-396/? E/qepo: is_quarter_epo_valid: Read QEPO file failed
08-02 14:35:05.051 758-758/? E/PermissionMonitor: can't find permission:android.permission.CHANGE_NETWORK_STATE
08-02 14:35:05.051 758-758/? E/PermissionMonitor: can't find permission:android.permission.CONNECTIVITY_INTERNAL
08-02 14:35:05.055 249-396/? E/qepo: is_quarter_epo_valid: Read QEPO file failed
08-02 14:35:05.081 249-396/? E/qepo: is_quarter_epo_valid: Read QEPO file failed
08-02 14:35:05.112 249-396/? E/qepo: is_quarter_epo_valid: Read QEPO file failed
08-02 14:35:05.141 758-1116/? E/CellLocation: create GsmCellLocation
08-02 14:35:05.145 249-396/? E/qepo: is_quarter_epo_valid: Read QEPO file failed
08-02 14:35:05.148 758-1116/? E/GnssLocationProvider: Error getting cell location info.
08-02 14:35:05.530 14127-14127/? E/MPlugin: Unsupported class: com.mediatek.common.telephony.IOnlyOwnerSimSupport
08-02 14:35:05.647 237-329/? E/agps: [agps] ERR: [AGPS] update_imsi_to_supl_swip IMSI is invalid
08-02 14:35:05.670 237-344/? E/agps: [agps] ERR: [SUPL_CONN_ADP] is_socket_valid socket_fds[s]=-1 is invalid
08-02 14:35:05.671 237-344/? E/agps: [agps] ERR: [SUPL_CONN_ADP] soc_close s=0 is invalid
08-02 14:35:05.768 3794-14020/? E/NetworkScheduler.SR: Invalid parameter app
08-02 14:35:05.768 3794-14020/? E/NetworkScheduler.SR: Invalid package name : Perhaps you didn't include a PendingIntent in the extras?
08-02 14:35:05.783 3794-14018/? E/MPlugin: Unsupported class: com.mediatek.common.telephony.IOnlyOwnerSimSupport
08-02 14:35:05.789 3810-8754/? E/Drive.UninstallOperation: Package still installed com.accessidico
08-02 14:35:05.977 12587-12587/? E/Finsky: [1] com.google.android.finsky.wear.bl.a(847): onConnectionFailed: ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}
08-02 14:35:06.296 3794-14020/? E/NetworkScheduler.SR: Invalid parameter app
08-02 14:35:06.296 3794-14020/? E/NetworkScheduler.SR: Invalid package name : Perhaps you didn't include a PendingIntent in the extras?
08-02 14:35:11.977 249-405/? E/MNLD: fsm_gps_state_started: fsm_gps_state_started() data1=0,data2=0,data3=0x0
08-02 14:35:12.026 249-405/? E/MNLD: fsm_gps_state_stopping: fsm_gps_state_stopping() data1=0,data2=0,data3=0x0
08-02 14:35:12.356 249-395/? E/epo: mtk_gps_epo_file_update: Update EPOHAL.DAT error
08-02 14:35:16.587 14219-14219/? E/PQ: [PQ][PQWhiteList] libwlparser.so is absent
08-02 14:35:16.956 9224-13999/? E/AudioRecord-JNI: Error -4 during AudioRecord native read
08-02 14:35:17.235 758-2532/? E/Sensors: handleToDriver handle(0)
08-02 14:35:17.236 758-2532/? E/Sensors: new setDelay handle(0),ns(66667000)m, error(0), index(2)
08-02 14:35:17.470 3794-3794/? E/ActivityThread: Service com.google.android.location.places.service.PlaceDetectionAsyncService has leaked IntentReceiver amth@cdb5c40 that was originally registered here. Are you missing a call to unregisterReceiver()?
android.app.IntentReceiverLeaked: Service com.google.android.location.places.service.PlaceDetectionAsyncService has leaked IntentReceiver amth@cdb5c40 that was originally registered here. Are you missing a call to unregisterReceiver()?
at android.app.LoadedApk$ReceiverDispatcher.<init>(LoadedApk.java:1201)
at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:951)
at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1314)
at android.app.ContextImpl.registerReceiver(ContextImpl.java:1294)
at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:593)
at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:593)
at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:593)
at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:593)
at amrb.run(:com.google.android.gms:4414)
at android.os.Handler.handleCallback(Handler.java:836)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:203)
at android.os.HandlerThread.run(HandlerThread.java:61)
08-02 14:35:17.473 3794-14255/? E/Places: IllegalArgumentException whilst unregistering receiver. Was SignalManager stopped before being started?
08-02 14:35:19.818 14229-14268/? E/ReactNativeJS: undefined is not an object (evaluating 'NativeReactModule.startApp')
08-02 14:35:19.877 14229-14268/? E/ReactNativeJS: Application AccessiDico has not been registered.
Hint: This error often happens when you're running the packager (local dev server) from a wrong folder. For example you have multiple apps and the packager is still running for the app you were working on before.
If this is the case, simply kill the old packager instance (e.g. close the packager terminal window) and start the packager in the correct app folder (e.g. cd into app folder and run 'npm start').
This error can also happen due to a require() error during initialization or failure to call AppRegistry.registerComponent.
[ 08-02 14:35:19.878 14229:14280 D/ ]
[Posix_connect Debug]Process com.accessidico :8081
08-02 14:35:22.406 249-395/? E/epo: mtk_gps_epo_file_update: Update EPOHAL.DAT error
我在设备上遇到的错误(链接到 react-native-navigation 包:https://wix.github.io/react-native-navigation/#/):
undefined is not an object (evaluating 'NativeReactModule.startApp')
所以我想知道,除了我的问题之外,什么是 "checklist" 来调试类似的东西?
什么是revelant?什么不是?
我应该首先在哪里研究解决方案?
P.S: 我已经按照 logcat 中显示的提示进行操作,但没有成功。
提前致谢。
这个问题是因为找不到native模块,在Android安装完react-native-navigation包后需要按照下面的steps
我的 React 本机应用程序遇到问题,我不知道如何继续调试它。
我花了我的时间来修复之间的不匹配:我正在使用的包的不同版本,不同的 upgrades/updates(包,react native,Android Studio 等),依赖项更多比实际编码或更正我的代码。
这真的很令人沮丧,我觉得我做错了或者因为这类问题而陷入困境。
这里是关于我当前问题的信息:
我有 消息构建 Gradle:
logcat:
--------- beginning of system
08-02 14:10:03.784 758-793/? E/BatteryStatsService: no controller energy info supplied
08-02 14:10:03.784 758-793/? E/BatteryStatsService: no controller energy info supplied
08-02 14:10:03.813 758-793/? E/BatteryStatsService: modem info is invalid: ModemActivityInfo{ mTimestamp=0 mSleepTimeMs=0 mIdleTimeMs=0 mTxTimeMs[]=[0, 0, 0, 0, 0] mRxTimeMs=0 mEnergyUsed=0}
08-02 14:12:03.754 758-793/? E/BatteryStatsService: no controller energy info supplied
08-02 14:12:03.754 758-793/? E/BatteryStatsService: no controller energy info supplied
08-02 14:12:03.796 758-793/? E/BatteryStatsService: modem info is invalid: ModemActivityInfo{ mTimestamp=0 mSleepTimeMs=0 mIdleTimeMs=0 mTxTimeMs[]=[0, 0, 0, 0, 0] mRxTimeMs=0 mEnergyUsed=0}
08-02 14:12:13.757 758-793/? E/BatteryStatsService: no controller energy info supplied
08-02 14:12:13.758 758-793/? E/BatteryStatsService: no controller energy info supplied
08-02 14:12:13.800 758-793/? E/BatteryStatsService: modem info is invalid: ModemActivityInfo{ mTimestamp=0 mSleepTimeMs=0 mIdleTimeMs=0 mTxTimeMs[]=[0, 0, 0, 0, 0] mRxTimeMs=0 mEnergyUsed=0}
08-02 14:34:43.308 249-396/? E/qepo: is_quarter_epo_valid: Read QEPO file failed
08-02 14:34:43.328 249-396/? E/qepo: is_quarter_epo_valid: Read QEPO file failed
08-02 14:34:43.347 249-396/? E/qepo: is_quarter_epo_valid: Read QEPO file failed
08-02 14:34:43.947 237-329/? E/agps: [agps] ERR: [AGPS] update_imsi_to_supl_swip IMSI is invalid
08-02 14:34:43.979 237-344/? E/agps: [agps] ERR: [SUPL_CONN_ADP] is_socket_valid socket_fds[s]=-1 is invalid
08-02 14:34:43.980 237-344/? E/agps: [agps] ERR: [SUPL_CONN_ADP] soc_close s=0 is invalid
08-02 14:34:45.481 758-7252/? E/Sensors: handleToDriver handle(0)
08-02 14:34:45.481 758-7252/? E/Sensors: new setDelay handle(0),ns(66667000)m, error(0), index(2)
08-02 14:34:52.228 249-395/? E/epo: mtk_gps_epo_file_update: Update EPOHAL.DAT error
08-02 14:34:58.495 14056-14056/? E/PQ: [PQ][PQWhiteList] libwlparser.so is absent
08-02 14:35:02.268 249-395/? E/epo: mtk_gps_epo_file_update: Update EPOHAL.DAT error
08-02 14:35:04.818 249-396/? E/qepo: is_quarter_epo_valid: Read QEPO file failed
08-02 14:35:04.819 249-405/? E/MNLD: fsm_gps_state_started: fsm_gps_state_started() data1=1,data2=0,data3=0x0
08-02 14:35:04.819 249-405/? E/MNLD: fsm_gps_state_started: fsm_gps_state_stopping() unexpected event=3
08-02 14:35:04.846 249-396/? E/qepo: is_quarter_epo_valid: Read QEPO file failed
08-02 14:35:04.890 249-396/? E/qepo: is_quarter_epo_valid: Read QEPO file failed
08-02 14:35:04.928 249-396/? E/qepo: is_quarter_epo_valid: Read QEPO file failed
08-02 14:35:04.957 249-396/? E/qepo: is_quarter_epo_valid: Read QEPO file failed
08-02 14:35:04.996 249-396/? E/qepo: is_quarter_epo_valid: Read QEPO file failed
08-02 14:35:05.026 249-396/? E/qepo: is_quarter_epo_valid: Read QEPO file failed
08-02 14:35:05.051 758-758/? E/PermissionMonitor: can't find permission:android.permission.CHANGE_NETWORK_STATE
08-02 14:35:05.051 758-758/? E/PermissionMonitor: can't find permission:android.permission.CONNECTIVITY_INTERNAL
08-02 14:35:05.055 249-396/? E/qepo: is_quarter_epo_valid: Read QEPO file failed
08-02 14:35:05.081 249-396/? E/qepo: is_quarter_epo_valid: Read QEPO file failed
08-02 14:35:05.112 249-396/? E/qepo: is_quarter_epo_valid: Read QEPO file failed
08-02 14:35:05.141 758-1116/? E/CellLocation: create GsmCellLocation
08-02 14:35:05.145 249-396/? E/qepo: is_quarter_epo_valid: Read QEPO file failed
08-02 14:35:05.148 758-1116/? E/GnssLocationProvider: Error getting cell location info.
08-02 14:35:05.530 14127-14127/? E/MPlugin: Unsupported class: com.mediatek.common.telephony.IOnlyOwnerSimSupport
08-02 14:35:05.647 237-329/? E/agps: [agps] ERR: [AGPS] update_imsi_to_supl_swip IMSI is invalid
08-02 14:35:05.670 237-344/? E/agps: [agps] ERR: [SUPL_CONN_ADP] is_socket_valid socket_fds[s]=-1 is invalid
08-02 14:35:05.671 237-344/? E/agps: [agps] ERR: [SUPL_CONN_ADP] soc_close s=0 is invalid
08-02 14:35:05.768 3794-14020/? E/NetworkScheduler.SR: Invalid parameter app
08-02 14:35:05.768 3794-14020/? E/NetworkScheduler.SR: Invalid package name : Perhaps you didn't include a PendingIntent in the extras?
08-02 14:35:05.783 3794-14018/? E/MPlugin: Unsupported class: com.mediatek.common.telephony.IOnlyOwnerSimSupport
08-02 14:35:05.789 3810-8754/? E/Drive.UninstallOperation: Package still installed com.accessidico
08-02 14:35:05.977 12587-12587/? E/Finsky: [1] com.google.android.finsky.wear.bl.a(847): onConnectionFailed: ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}
08-02 14:35:06.296 3794-14020/? E/NetworkScheduler.SR: Invalid parameter app
08-02 14:35:06.296 3794-14020/? E/NetworkScheduler.SR: Invalid package name : Perhaps you didn't include a PendingIntent in the extras?
08-02 14:35:11.977 249-405/? E/MNLD: fsm_gps_state_started: fsm_gps_state_started() data1=0,data2=0,data3=0x0
08-02 14:35:12.026 249-405/? E/MNLD: fsm_gps_state_stopping: fsm_gps_state_stopping() data1=0,data2=0,data3=0x0
08-02 14:35:12.356 249-395/? E/epo: mtk_gps_epo_file_update: Update EPOHAL.DAT error
08-02 14:35:16.587 14219-14219/? E/PQ: [PQ][PQWhiteList] libwlparser.so is absent
08-02 14:35:16.956 9224-13999/? E/AudioRecord-JNI: Error -4 during AudioRecord native read
08-02 14:35:17.235 758-2532/? E/Sensors: handleToDriver handle(0)
08-02 14:35:17.236 758-2532/? E/Sensors: new setDelay handle(0),ns(66667000)m, error(0), index(2)
08-02 14:35:17.470 3794-3794/? E/ActivityThread: Service com.google.android.location.places.service.PlaceDetectionAsyncService has leaked IntentReceiver amth@cdb5c40 that was originally registered here. Are you missing a call to unregisterReceiver()?
android.app.IntentReceiverLeaked: Service com.google.android.location.places.service.PlaceDetectionAsyncService has leaked IntentReceiver amth@cdb5c40 that was originally registered here. Are you missing a call to unregisterReceiver()?
at android.app.LoadedApk$ReceiverDispatcher.<init>(LoadedApk.java:1201)
at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:951)
at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1314)
at android.app.ContextImpl.registerReceiver(ContextImpl.java:1294)
at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:593)
at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:593)
at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:593)
at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:593)
at amrb.run(:com.google.android.gms:4414)
at android.os.Handler.handleCallback(Handler.java:836)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:203)
at android.os.HandlerThread.run(HandlerThread.java:61)
08-02 14:35:17.473 3794-14255/? E/Places: IllegalArgumentException whilst unregistering receiver. Was SignalManager stopped before being started?
08-02 14:35:19.818 14229-14268/? E/ReactNativeJS: undefined is not an object (evaluating 'NativeReactModule.startApp')
08-02 14:35:19.877 14229-14268/? E/ReactNativeJS: Application AccessiDico has not been registered.
Hint: This error often happens when you're running the packager (local dev server) from a wrong folder. For example you have multiple apps and the packager is still running for the app you were working on before.
If this is the case, simply kill the old packager instance (e.g. close the packager terminal window) and start the packager in the correct app folder (e.g. cd into app folder and run 'npm start').
This error can also happen due to a require() error during initialization or failure to call AppRegistry.registerComponent.
[ 08-02 14:35:19.878 14229:14280 D/ ]
[Posix_connect Debug]Process com.accessidico :8081
08-02 14:35:22.406 249-395/? E/epo: mtk_gps_epo_file_update: Update EPOHAL.DAT error
我在设备上遇到的错误(链接到 react-native-navigation 包:https://wix.github.io/react-native-navigation/#/):
undefined is not an object (evaluating 'NativeReactModule.startApp')
所以我想知道,除了我的问题之外,什么是 "checklist" 来调试类似的东西?
什么是revelant?什么不是?
我应该首先在哪里研究解决方案?
P.S: 我已经按照 logcat 中显示的提示进行操作,但没有成功。
提前致谢。
这个问题是因为找不到native模块,在Android安装完react-native-navigation包后需要按照下面的steps