我react-native start在一个终端运行,然后react-native ios-run在另一个终端运行.我最初console.log很少表现,有时他们会这样做.
很多次,随机我看到:
日志消息语录超出 - 此过程中的一些消息已被丢弃
我console.log被丢弃了吗?我试着清理控制台以便更清楚地看到它,但我也找不到清除控制台的方法.
在Android上,我不会有丢失的问题console.log.
我正在使用Native-Base.我需要使用单选按钮,但它们不起作用.当你点击没有任何反应.这是代码.
import React, { Component } from 'react';
import { Container, Header, Content, ListItem, Text, Radio, Right } from 'native-base';
export default class RadioButtonExample extends Component {
render() {
return (
<Container>
<Header />
<Content>
<ListItem>
<Text>Daily Stand Up</Text>
<Right>
<Radio selected={false} />
</Right>
</ListItem>
<ListItem>
<Text>Discussion with Client</Text>
<Right>
<Radio selected={true} />
</Right>
</ListItem>
</Content>
</Container>
);
}
}
Run Code Online (Sandbox Code Playgroud)
我怎样才能使它工作?请不要发送仅包含单选按钮功能的不同库.我已经检查了不同的单选按钮库.只需要在此代码中添加一些内容即可使其正常工作.
react-native react-native-android native-base react-native-ios
我想使用expokit和其他本机库,我该怎么做?
我是否需要使用create-react-native-app启动我的应用程序,然后将其分离,或者我可以从react-native init应用程序启动?
我在iOS模拟器上运行的React Native的SVG库存在问题.
"dependencies": {
"better-fetch": "^1.1.2",
"firebase": "^4.8.1",
"lodash": "^4.17.4",
"react": "16.0.0",
"react-native": "0.51.0",
"react-native-svg": "^6.0.1-rc.1",
"react-redux": "^5.0.6",
"redux": "^3.7.2",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.2.0"
}
Run Code Online (Sandbox Code Playgroud)
我试过以下无济于事:
npm install react-native-svg --save //(again)
react-native link react-native-svg //(again)
watchman watch-del-all
rm -rf node_modules/ && yarn cache clean && yarn install
Run Code Online (Sandbox Code Playgroud)
我试过__CODE__等等但是没有一个在哪里工作正常.任何人都可以建议我__CODE__从设备存储中选择文件.
我一直在寻找一种限制用户的解决方案,只需点击一下本机就可以退出应用程序.
double-click exit react-native react-native-android react-native-ios
使用React Native Fetch API时遇到问题。很多次请求失败。我有高速连接。但是很多次失败了。该问题正在android和ios中同时发生。
const shoppingApi = 'myserverlink';
async function Sendshoppinapi(data) {
try {
let response = await fetch(shoppingApi, {
method: 'POST',
headers: {
'Accept': 'application/json',
'content-type':'multipart/form-data'
},
body: data
});
let responseJson = await response.json();
return responseJson;
}
catch (error) {
Alert.alert(error.toString())
}
}
export {Sendshoppinapi};
Run Code Online (Sandbox Code Playgroud)
我发送服务器作为后期请求的数据
add_to_wishlist = (item,index) => {
{
let data = new FormData();
data.append('methodName', 'add_to_wishlist');
data.append('user_id', global.userid)
data.append('item_id', this.props.navigation.state.params.itemid.toString())
Sendshoppinapi(data).then((responseJson)=>{
console.warn(responseJson);
if(responseJson.responseCode == '200'){
this.setState({fav:false})
Alert.alert('SHOPPING','Item added to wishlist successfully.',[{text: 'OK',},],{ cancelable: false }) …Run Code Online (Sandbox Code Playgroud) 我正在一个现有的React Native项目上,在XCode日志输出中,我得到了以下错误的源源不断
2019-01-09 12:15:49.005630+0000 App [13746:3543026] [] nw_socket_handle_socket_event [C10.1:1] Socket SO_ERROR [61: Connection refused]
2019-01-09 12:15:49.016640+0000 App [13746:3543026] [] nw_socket_handle_socket_event [C10.2:1] Socket SO_ERROR [61: Connection refused]
2019-01-09 12:15:49.017800+0000 App [13746:3543010] [] nw_connection_get_connected_socket [C10] Client called nw_connection_get_connected_socket on unconnected nw_connection
Run Code Online (Sandbox Code Playgroud)
我该如何找出错误的出处?它似乎并没有影响应用程序,但我想了解这个问题。我怀疑这不是应用程序的JavaScript代码,而是所使用的pod之一:
pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'Firebase/Crash'
Run Code Online (Sandbox Code Playgroud) 我已经看到了一些类似的问题。但是他们都没有解决我的问题。react-native-cli:2.0.1 react-native:0.59.4模拟器版本10.1(SimulatorApp-877 CoreSimulator-587.35)Xcode版本10.2(10E125)
将xcode升级到10.2后,此问题开始了,以下生成命令失败:CompileXIB /Users/rezwanakabita/Desktop/Navigation_Practice/react-native-firebase-starter/ios/RNFirebaseStarter/Base.lproj/LaunchScreen.xib(1个失败)
我尝试了StackOverflow先前问题中的所有解决方案。但是没有一个解决我的问题。任何帮助,将不胜感激。谢谢。
{
"name": "RNFirebaseStarter",
"version": "5.3.0",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios --simulator=\"iPhone X\"",
"apk": "cd android && ./gradlew assembleRelease",
"rename": "node ./bin/rename.js",
"start": "react-native start",
"test": "jest"
},
"dependencies": {
"react": "16.8.3",
"react-native": "0.59.4",
"react-native-firebase": "5.3.0",
"realm": "^2.26.0"
},
"devDependencies": {
"@babel/core": "^7.4.3",
"@babel/runtime": "^7.4.3",
"babel-jest": "^24.7.1",
"jest": "^24.7.1",
"metro-react-native-babel-preset": "^0.53.1",
"react-test-renderer": "16.8.3"
},
"jest": {
"preset": "react-native"
}
}
Run Code Online (Sandbox Code Playgroud) 我正在开发一个从 0.59 升级到 0.60 的 React Native 应用程序。我已经整理了 cocoapods,我可以在模拟器中从 Xcode 成功构建和运行应用程序。但是,当我尝试使用运行该应用程序时react-native run-ios --scheme "app"出现错误:
xcodebuild: error: The workspace named "app" does not contain a scheme named "app". The "-list" option can be used to find the names of the schemes in the workspace.
Run Code Online (Sandbox Code Playgroud)
我有一个 app.xcworkspace 文件,我正在 Xcode 中打开它。我在“管理方案”对话框中共享了“应用程序”方案,并将其容器设置为工作区。
Xcode 已创建文件ios/app.xcworkspace/xcshareddata/xcschemes/app.xcscheme.
当我运行时,xcodebuild -workspace app.xcworkspace -list我看到:
Information about workspace "app":
Schemes:
app
app-tvOS
boost-for-react-native
DoubleConversion
Folly
glog
Pods-app
Pods-app-tvOS
Pods-app-tvOSTests
Pods-appTests
React
React-Core
...
Run Code Online (Sandbox Code Playgroud)
以前,该react-native …
react-native ×10
react-native-ios ×10
xcode ×2
cocoapods ×1
double-click ×1
exit ×1
ios ×1
native-base ×1
reactjs ×1
svg ×1
xcodebuild ×1