gpt4 book ai didi

ios - React native - 连接没有连接处理程序错误含义?

转载 作者:IT王子 更新时间:2023-10-29 07:42:35 25 4
gpt4 key购买 nike

我创建了一个新的 React 项目,当我在 iOS 上从 xcode 运行它时,控制台给了我这个:

2017-05-19 23:25:34.119 [info][tid:main][RCTBatchedBridge.m:77] Initializing <RCTBatchedBridge: 0x6100001a6c80> (parent: <RCTBridge: 0x6100000c46e0>, executor: RCTJSCExecutor)
2017-05-19 23:25:51.287 [info][tid:main][RCTRootView.m:295] Running application test ({
initialProps = {
};
rootTag = 1;
})
2017-05-19 23:25:51.289 [info][tid:com.facebook.react.JavaScript] Running application "test" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF
2017-05-19 23:25:51.299771-0400 test[21948:1121429] [] nw_connection_get_connected_socket_block_invoke 3 Connection has no connected handler
2017-05-19 23:25:53.335282-0400 test[21948:1121426] [] nw_connection_get_connected_socket_block_invoke 4 Connection has no connected handler
2017-05-19 23:25:55.349190-0400 test[21948:1120112] [] nw_connection_get_connected_socket_block_invoke 5 Connection has no connected handler

什么 2017-05-19 23:25:51.299771-0400 test[21948:1121429] [] nw_connection_get_connected_socket_block_invoke 3 Connection has no connected handler 这些行是什么意思,我该如何解决这个问题?

当我尝试在我的应用程序中使用 fetch 并发现它不起作用时,我首先注意到了这一点。我在控制台中发现了这些消息,后来发现这些消息出现在我的所有应用程序中,所以我认为这意味着这是我的配置问题?

我创建了一个新的测试程序来测试导致这种情况的原因,并发现它发生在一个全新的项目中。下面是我的代码是生成上面的日志输出:

/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/

import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';

export default class test extends Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
Welcome to React Native!
</Text>
<Text style={styles.instructions}>
To get started, edit index.ios.js
</Text>
<Text style={styles.instructions}>
Press Cmd+R to reload,{'\n'}
Cmd+D or shake for dev menu
</Text>
</View>
);
}
}

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});

AppRegistry.registerComponent('test', () => test);

最佳答案

尝试以下流程

Xcode 菜单 -> 产品 -> 编辑方案...

环境变量 -> 添加 -> 名称:“OS_ACTIVITY_MODE”,值:“禁用”

再次运行您的应用

关于ios - React native - 连接没有连接处理程序错误含义?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44081674/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com