我在 React Native 中有一个项目,由于以下错误,我无法在 Android Studio 上构建。
这是带有附加信息的详细日志:
java.io.IOException: Cannot run program "node" (in directory "/Users/fabioernanni/git/fintech-ewallet-mobile/android"): error=2, No such file or directory
java.io.IOException: error=2, No such file or directory
Cause: error=2, No such file or directory
Run Code Online (Sandbox Code Playgroud)
我尝试重新安装 Node、Android Studio,以链接 tscript 库,以便 Android Studio 能够识别“节点”,但似乎没有任何帮助。
我有 2 个组件,DraggableCard 和 ChooseMachine(ChooseMachine 使用 DraggableCard)。当我到达 ChooseMachine 组件时,它返回错误:The specified child already has a parent. You must call removeView() on the child's parent first.
我不知道哪个子组件被调用了两次。
我尝试删除Some Text作为道具传递给 DraggableCard 的 ,这解决了错误,但 DraggableCard 没有显示,这不完全是我需要的。它应该显示 DraggableCard 和传递的文本。我已经尝试过绕过Some Text标签,但问题仍然存在。
import React, {Component} from 'react'
import {View} from 'react-native'
import MapView from 'react-native-maps'
import styles from './style'
import DraggableCard from '../../components/DraggableCard'
export default class ChooseMachine extends Component{
render(){
return(
<View style={styles.body}>
<MapView
style={styles.map}>
<DraggableCard>
Some Text
</DraggableCard>
</MapView>
</View>
) …Run Code Online (Sandbox Code Playgroud)