Skip to main content
Answered

IllegalStateException The specified child already has a parent. You must call removeView() on the child's parent first


We are getting a great number of crashes on the Android version 14.1.0.
This seems to happen to the conversation_list RecyclerView.

You can find the stack trace bellow:

java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
    at android.view.ViewGroup.addViewInner(ViewGroup.java:4471)
    at android.view.ViewGroup.addView(ViewGroup.java:4312)
    at android.view.ViewGroup.addView(ViewGroup.java:4252)
    at android.view.ViewGroup.addView(ViewGroup.java:4225)
    at androidx.compose.ui.viewinterop.AndroidViewHolder.setView$ui_release(AndroidViewHolder.android.kt:97)
    at androidx.compose.ui.viewinterop.ViewFactoryHolder.<init>(AndroidView.android.kt:332)
    at androidx.compose.ui.viewinterop.ViewFactoryHolder.<init>(AndroidView.android.kt:312)
    at androidx.compose.ui.viewinterop.AndroidView_androidKt$createAndroidViewNodeFactory$1.invoke(AndroidView.android.kt:247)
    at androidx.compose.ui.viewinterop.AndroidView_androidKt$createAndroidViewNodeFactory$1.invoke(AndroidView.android.kt:246)
    at androidx.compose.runtime.ComposablesKt$ComposeNode$1.invoke
    at androidx.compose.ui.viewinterop.AndroidView_androidKt$AndroidView$$inlined$ComposeNode$1.invoke(Composables.kt:0)
    at androidx.compose.runtime.ComposerImpl$createNode$2.invoke(Composer.kt:1617)
    at androidx.compose.runtime.ComposerImpl$createNode$2.invoke(Composer.kt:1613)
    at androidx.compose.runtime.ComposerImpl$recordInsert$2.invoke(Composer.kt:3554)
    at androidx.compose.runtime.ComposerImpl$recordInsert$2.invoke(Composer.kt:3551)
    at androidx.compose.runtime.CompositionImpl.applyChangesInLocked(Composition.kt:810)
    at androidx.compose.runtime.CompositionImpl.applyChanges(Composition.kt:844)
    at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:592)
    at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:510)
    at androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame(AndroidUiFrameClock.android.kt:0)
    at androidx.compose.ui.platform.AndroidUiDispatcher.performFrameDispatch
    at androidx.compose.ui.platform.AndroidUiDispatcher.access$performFrameDispatch
    at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.android.kt:69)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:921)
    at android.view.Choreographer.doCallbacks(Choreographer.java:735)
    at android.view.Choreographer.doFrame(Choreographer.java:664)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:909)
    at android.os.Handler.handleCallback(Handler.java:761)
    at android.os.Handler.dispatchMessage(Handler.java:98)
    at android.os.Looper.loop(Looper.java:156)
    at android.app.ActivityThread.main(ActivityThread.java:6523)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:831)

We are on Kotlin 1.8.10 and androidx.compose.material:material 1.3.1

Best answer by Racheal

Hey @Kostas Tsalikis Racheal from the support engineer team here👋 

Is this happening specifically with Intercom? I ask because it looks like this is a fairly common and straight forward error within Android (looking at this Stack Overflow here). I’m not seeing any other reports of this error but if you are still experiencing it I’m happy to forward this conversation into support so we can take a better look. Let me know! 😊

View original
Did this topic help you find an answer to your question?

3 replies

Racheal
Intercom Team
Forum|alt.badge.img+5
  • Customer Support Engineer
  • 512 replies
  • Answer
  • May 8, 2023

Hey @Kostas Tsalikis Racheal from the support engineer team here👋 

Is this happening specifically with Intercom? I ask because it looks like this is a fairly common and straight forward error within Android (looking at this Stack Overflow here). I’m not seeing any other reports of this error but if you are still experiencing it I’m happy to forward this conversation into support so we can take a better look. Let me know! 😊


HI @Racheal thanks for getting back!

This happens only with Intercom, we don’t get this kind of crash elsewhere in our app.


  • New Participant
  • 1 reply
  • March 14, 2025

Hi, we are receiving the same crash as well on android 9,11,13,14 (dont think its OS version specific). We are using jetpack compose so seems to be an issue with the interop handling. There is no use of android viewholder within our own code, also based on logs from firebase, it always occurs when intercom screen is opened, so this is caused by the intercom SDK. Here is the stacktrace:

 

Fatal Exception: java.lang.IllegalStateException
The specified child already has a parent. You must call removeView() on the child's parent first.
android.view.ViewGroup.addViewInner (ViewGroup.java:5248)
android.view.ViewGroup.addView (ViewGroup.java:5077)
android.view.ViewGroup.addView (ViewGroup.java:5017)
android.view.ViewGroup.addView (ViewGroup.java:4989)
androidx.compose.ui.viewinterop.AndroidViewHolder.<init> (AndroidViewHolder.android.kt:99)
androidx.compose.ui.viewinterop.ViewFactoryHolder.<init> (AndroidView.android.kt:332)
androidx.compose.ui.viewinterop.ViewFactoryHolder.<init> (AndroidView.android.kt:323)
androidx.compose.ui.viewinterop.ViewFactoryHolder.<init> (AndroidView.android.kt:342)
androidx.compose.ui.viewinterop.AndroidView_androidKt$createAndroidViewNodeFactory$1$1.invoke (AndroidView_android.kt:275)
androidx.compose.ui.viewinterop.AndroidView_androidKt$createAndroidViewNodeFactory$1$1.invoke (AndroidView_android.kt:274)
androidx.compose.runtime.changelist.Operation$InsertNodeFixup.execute (Operation.kt:585)
androidx.compose.runtime.changelist.Operations.executeAndFlushAllPendingOperations (Operations.kt:310)
androidx.compose.runtime.changelist.FixupList.executeAndFlushAllPendingFixups (FixupList.java:50)
androidx.compose.runtime.changelist.Operation$InsertSlotsWithFixups.execute (Operation.kt:552)
androidx.compose.runtime.changelist.Operations.executeAndFlushAllPendingOperations (Operations.kt:310)
androidx.compose.runtime.changelist.ChangeList.executeAndFlushAllPendingChanges (ChangeList.kt:81)
androidx.compose.runtime.CompositionImpl.applyChangesInLocked (Composition.kt:984)
androidx.compose.runtime.CompositionImpl.applyChanges (Composition.kt:1013)
androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$1.invoke (Recomposer.java:685)
androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$1.invoke (Recomposer.java:585)
androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame (AndroidUiFrameClock.android.kt:41)
androidx.compose.ui.platform.AndroidUiDispatcher.performFrameDispatch (AndroidUiDispatcher.java:109)
androidx.compose.ui.platform.AndroidUiDispatcher.access$performFrameDispatch (AndroidUiDispatcher.java:41)
androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame (AndroidUiDispatcher.android.kt:69)
android.view.Choreographer$CallbackRecord.run (Choreographer.java:1317)
android.view.Choreographer$CallbackRecord.run (Choreographer.java:1327)
android.view.Choreographer.doCallbacks (Choreographer.java:985)
android.view.Choreographer.doFrame (Choreographer.java:911)
android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:1302)
android.os.Handler.handleCallback (Handler.java:942)
android.os.Handler.dispatchMessage (Handler.java:99)
android.os.Looper.loopOnce (Looper.java:201)
android.os.Looper.loop (Looper.java:288)
android.app.ActivityThread.main (ActivityThread.java:7918)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:548)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:942)

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings