1

When I test my app on android there is this error. It works perfectly with ios. Does anybody has a clue what this exactly means? I don't get it. What child does the error mean?

enter image description here

the render() looks like this:

<code>

    render() {
      if(this.state.map && this.hideClicked){
        this.loadMap()
      }
      return (
        <View style={styles.mapContainer}>
        { this.state.map ? 
        <MapView
          showsUserLocation={true}
          style={styles.map}
          provider='google'
          ref={ref => { map3 = ref; }}
          onMapReady = { this.onMapReady }
          initialRegion={this.state.region}
          >
          <Button 
            title={"Hide Map"}
            fontSize={11}
            buttonStyle={styles.button}
            onPress={this.hideMap} >
            </Button>
            <Marker 
            image={logo}
            coordinate={this.state.coordinate}
            />
            </MapView>
         : null }
            { this.state.map ? null :
            <Button 
            title={ "Show Map"} 
            fontSize={11}
            buttonStyle={styles.button}
            onPress={this.hideMap} ></Button>
            }        
            { this.state.map ? 
            <MapDistanceComponent distance={this.state.distance} />
            : <DistanceComponent distance={this.state.distance} />
            }
      </View>
</code>
Arnab
  • 4,216
  • 2
  • 28
  • 50
user9468014
  • 479
  • 2
  • 6
  • 20
  • what loadMap does? – Paolo Dell'Aguzzo Jul 04 '18 at 11:36
  • loadMap = () => { var changeState = (newDistance) => this.setState({distance: newDistance}) – user9468014 Jul 04 '18 at 14:27
  • It should have something to do with the buttons I added it worked before – user9468014 Jul 04 '18 at 14:28
  • Seeing this https://stackoverflow.com/questions/28071349/the-specified-child-already-has-a-parent-you-must-call-removeview-on-the-chil and even this: https://github.com/cnjon/react-native-pdf-view/issues/39 and even this: https://github.com/gitim/react-native-sortable-list/issues/2 I think that the problem is on the Java side.Probably this.state.map change too many times? You have too many this.state.map conditional operators I think. Probably you can create a function that returns the this.state.map version and without map version. – Paolo Dell'Aguzzo Jul 04 '18 at 14:42
  • on a completely other node. What did you use for your website "https://www.paolodellaguzzo.com/"? It looks really good – user9468014 Jul 10 '18 at 12:12
  • Just Wordpress and some ReactJS. – Paolo Dell'Aguzzo Jul 16 '18 at 06:40

0 Answers0