简体   繁体   English

React Native:获取请求不适用于活动的远程调试器(Android)

[英]React Native: Fetch requests are not working with remote debugger active (Android)

I am going through a weird issue with RN that doesn't seem to allow requests to work without the debugger active. 我正在经历一个与RN有关的怪异问题,该问题似乎不允许在调试器未激活的情况下执行请求。 The basic repro is try to fetch from an external API on Android without the debugger active. 基本的复制是尝试在未激活调试器的情况下从Android上的外部API获取。 We aren't doing anything different from the examples given at all. 我们与给出的示例没有任何不同。 No errors showing in the logs, in fact from the looks of it they work and we have the data but the app refuses to update redux for some reason. 日志中没有显示任何错误,实际上从它们的外观来看它们可以正常工作,并且我们有数据,但是该应用出于某种原因拒绝更新redux。 It basically soft locks but doesn't crash. 它基本上是软锁,但不会崩溃。 If I can provide any better information let me know, I'm just unsure why I'm seeing this issue only on Android while iOS works totally fine. 如果我能提供更多更好的信息,请告诉我,我只是不确定为什么我只在Android上看到此问题,而iOS正常运行。

I should've come back to this to say I found an answer. 我应该回到这个位置说我找到了答案。 Required on Android only but simply use this: 仅在Android上必需,但只需使用以下命令:

import 'babel-polyfill';

It should work then. 那应该可以了。 It was specific to the API and parsing some data coming through that wasn't being logged for whatever reason. 它特定于API,并且解析由于某些原因而未记录的某些数据。 We found it through crash data recovered on AppCenter.ms through CodePush. 我们通过CodePush在AppCenter.ms上恢复的崩溃数据找到了它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM