Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The specified child already has a parent. #58

Closed
AareFabrik opened this issue Nov 20, 2018 · 1 comment
Closed

The specified child already has a parent. #58

AareFabrik opened this issue Nov 20, 2018 · 1 comment

Comments

@AareFabrik
Copy link

Hi,

I think there is a bug:

  • react-native: 0.56
  • react-native-maps: 0.22.0
  • react-native-maps-super-cluster: 1.5.0

First I got this issue react-native-maps/react-native-maps#2507

Then I fixed it by the PR: react-native-maps/react-native-maps#2555

But I got the following error:

screenshot 2018-11-20 at 15 41 06

The specified child already has a parent. You must call removeView() on the child's parent first.
addViewInner
    ViewGroup.java:4309
addView
    ViewGroup.java:4145
addView
    ReactViewGroup.java:432
addView
    ViewGroup.java:4086
addView
    ViewGroup.java:4059
addFeature
    AirMapView.java:546
addView
    AirMapManager.java:400
addView
    AirMapManager.java:29
manageChildren
    NativeViewHierarchyManager.java:437
execute
    UIViewOperationQueue.java:227
run
    UIViewOperationQueue.java:894
flushPendingBatches
    UIViewOperationQueue.java:1001
access$2400
    UIViewOperationQueue.java:46
doFrameGuarded
    UIViewOperationQueue.java:1061
doFrame
    GuardedFrameCallback.java:29
doFrame
    ReactChoreographer.java:134
doFrame
    ChoreographerCompat.java:105
run
    Choreographer.java:856
doCallbacks
    Choreographer.java:670
doFrame
    Choreographer.java:603
run
    Choreographer.java:844
handleCallback
    Handler.java:739
dispatchMessage
    Handler.java:95
loop
    Looper.java:148
main
    ActivityThread.java:5417
invoke
    Method.java
run
    ZygoteInit.java:726
main
    ZygoteInit.java:616

Any ideas? Thanks a lot!

@dnazarov
Copy link

Hi.
I found out this problem when run the app on Android, the iOS project works well.
In my case solution was changing key from object_id to indexer.

<MapView ... >
{
_.map(clusterData, (item, index) => (
   <Marker
                coordinate={{longitude:  item.coordinates[0], latitude: item.coordinates[1]}}
                onPress={() => this._markerPresed(item)}
               key={index}
            />
) );
}
</MapView>

There was key={item.id}
I don't know why, but key={index} works well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants