ConstraintLayout crash with StackOverflowError










6















I have multiple strange crash reports via Firebase Crashlytics during last week from different devices.
They are:



  • 100% from Android 4 (4.2 - 4.4)

  • Mostly (98%) from Samsung tablets

Stack traces are identical and doesn't include any reference to my code, so I dont know where crash happen and why. Searching for my exception gives nothing. So I hope somebody can help me investigating that crashes. As I understand, crash happen somewhere inside ConstraintLayout library (I use version 1.1.3).



Crash stack trace:



Fatal Exception: java.lang.StackOverflowError
at java.util.HashMap$KeySet.<init>(HashMap.java:911)
at java.util.HashMap$KeySet.<init>(HashMap.java:911)
at java.util.HashMap.keySet(HashMap.java:696)
at java.util.HashSet.iterator(HashSet.java:161)
at android.support.constraint.solver.widgets.ResolutionNode.didResolve(ResolutionNode.java:70)
at android.support.constraint.solver.widgets.ResolutionAnchor.resolve(ResolutionAnchor.java:140)
at android.support.constraint.solver.widgets.ResolutionNode.didResolve(ResolutionNode.java:71)
at android.support.constraint.solver.widgets.ResolutionAnchor.resolve(ResolutionAnchor.java:140)
----A lot of identical lines----
at android.support.constraint.solver.widgets.ResolutionNode.didResolve(ResolutionNode.java:71)
at android.support.constraint.solver.widgets.ResolutionAnchor.resolve(ResolutionAnchor.java:85)
at android.support.constraint.solver.widgets.ConstraintWidgetContainer.solveGraph(ConstraintWidgetContainer.java:586)
at android.support.constraint.solver.widgets.ConstraintWidgetContainer.optimize(ConstraintWidgetContainer.java:643)
at android.support.constraint.solver.widgets.ConstraintWidgetContainer.layout(ConstraintWidgetContainer.java:328)
at android.support.constraint.ConstraintLayout.solveLinearSystem(ConstraintLayout.java:1860)
at android.support.constraint.ConstraintLayout.onMeasure(ConstraintLayout.java:1621)
at android.view.View.measure(View.java:16749)
at android.widget.ScrollView.measureChildWithMargins(ScrollView.java:1235)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.widget.ScrollView.onMeasure(ScrollView.java:327)
at android.view.View.measure(View.java:16749)
at android.support.constraint.ConstraintLayout.internalMeasureChildren(ConstraintLayout.java:1227)
at android.support.constraint.ConstraintLayout.onMeasure(ConstraintLayout.java:1572)
at android.view.View.measure(View.java:16749)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5295)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:143)
at android.view.View.measure(View.java:16749)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5295)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1413)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:696)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:589)
at android.view.View.measure(View.java:16749)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5295)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.view.View.measure(View.java:16749)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5295)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1413)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:696)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:589)
at android.view.View.measure(View.java:16749)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5295)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2439)
at android.view.View.measure(View.java:16749)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2072)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1175)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1372)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1062)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5996)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
at android.view.Choreographer.doCallbacks(Choreographer.java:574)
at android.view.Choreographer.doFrame(Choreographer.java:544)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5590)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
at dalvik.system.NativeStart.main(NativeStart.java)


Please help me to find out the reason of that crash or at least how to reproduce it.



UPD:



With help of my users I found out a place, where crash happens. It's an activity, where layout is not inflated from xml but generated in onCreate() by code (ConstraintLayout as root).










share|improve this question
























  • Check if you have put some "difficult" constraints (e.g. circular).

    – Henry
    Oct 29 '18 at 14:19











  • No, all constraints are simple. Maximum "difficulty" - is using Barriers. It's sad, that I dont know how to reproduce that crash. And layout that cause it. Difficult constraints can cause such exception?

    – Andrei Vinogradov
    Oct 29 '18 at 14:22
















6















I have multiple strange crash reports via Firebase Crashlytics during last week from different devices.
They are:



  • 100% from Android 4 (4.2 - 4.4)

  • Mostly (98%) from Samsung tablets

Stack traces are identical and doesn't include any reference to my code, so I dont know where crash happen and why. Searching for my exception gives nothing. So I hope somebody can help me investigating that crashes. As I understand, crash happen somewhere inside ConstraintLayout library (I use version 1.1.3).



Crash stack trace:



Fatal Exception: java.lang.StackOverflowError
at java.util.HashMap$KeySet.<init>(HashMap.java:911)
at java.util.HashMap$KeySet.<init>(HashMap.java:911)
at java.util.HashMap.keySet(HashMap.java:696)
at java.util.HashSet.iterator(HashSet.java:161)
at android.support.constraint.solver.widgets.ResolutionNode.didResolve(ResolutionNode.java:70)
at android.support.constraint.solver.widgets.ResolutionAnchor.resolve(ResolutionAnchor.java:140)
at android.support.constraint.solver.widgets.ResolutionNode.didResolve(ResolutionNode.java:71)
at android.support.constraint.solver.widgets.ResolutionAnchor.resolve(ResolutionAnchor.java:140)
----A lot of identical lines----
at android.support.constraint.solver.widgets.ResolutionNode.didResolve(ResolutionNode.java:71)
at android.support.constraint.solver.widgets.ResolutionAnchor.resolve(ResolutionAnchor.java:85)
at android.support.constraint.solver.widgets.ConstraintWidgetContainer.solveGraph(ConstraintWidgetContainer.java:586)
at android.support.constraint.solver.widgets.ConstraintWidgetContainer.optimize(ConstraintWidgetContainer.java:643)
at android.support.constraint.solver.widgets.ConstraintWidgetContainer.layout(ConstraintWidgetContainer.java:328)
at android.support.constraint.ConstraintLayout.solveLinearSystem(ConstraintLayout.java:1860)
at android.support.constraint.ConstraintLayout.onMeasure(ConstraintLayout.java:1621)
at android.view.View.measure(View.java:16749)
at android.widget.ScrollView.measureChildWithMargins(ScrollView.java:1235)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.widget.ScrollView.onMeasure(ScrollView.java:327)
at android.view.View.measure(View.java:16749)
at android.support.constraint.ConstraintLayout.internalMeasureChildren(ConstraintLayout.java:1227)
at android.support.constraint.ConstraintLayout.onMeasure(ConstraintLayout.java:1572)
at android.view.View.measure(View.java:16749)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5295)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:143)
at android.view.View.measure(View.java:16749)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5295)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1413)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:696)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:589)
at android.view.View.measure(View.java:16749)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5295)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.view.View.measure(View.java:16749)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5295)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1413)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:696)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:589)
at android.view.View.measure(View.java:16749)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5295)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2439)
at android.view.View.measure(View.java:16749)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2072)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1175)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1372)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1062)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5996)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
at android.view.Choreographer.doCallbacks(Choreographer.java:574)
at android.view.Choreographer.doFrame(Choreographer.java:544)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5590)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
at dalvik.system.NativeStart.main(NativeStart.java)


Please help me to find out the reason of that crash or at least how to reproduce it.



UPD:



With help of my users I found out a place, where crash happens. It's an activity, where layout is not inflated from xml but generated in onCreate() by code (ConstraintLayout as root).










share|improve this question
























  • Check if you have put some "difficult" constraints (e.g. circular).

    – Henry
    Oct 29 '18 at 14:19











  • No, all constraints are simple. Maximum "difficulty" - is using Barriers. It's sad, that I dont know how to reproduce that crash. And layout that cause it. Difficult constraints can cause such exception?

    – Andrei Vinogradov
    Oct 29 '18 at 14:22














6












6








6


1






I have multiple strange crash reports via Firebase Crashlytics during last week from different devices.
They are:



  • 100% from Android 4 (4.2 - 4.4)

  • Mostly (98%) from Samsung tablets

Stack traces are identical and doesn't include any reference to my code, so I dont know where crash happen and why. Searching for my exception gives nothing. So I hope somebody can help me investigating that crashes. As I understand, crash happen somewhere inside ConstraintLayout library (I use version 1.1.3).



Crash stack trace:



Fatal Exception: java.lang.StackOverflowError
at java.util.HashMap$KeySet.<init>(HashMap.java:911)
at java.util.HashMap$KeySet.<init>(HashMap.java:911)
at java.util.HashMap.keySet(HashMap.java:696)
at java.util.HashSet.iterator(HashSet.java:161)
at android.support.constraint.solver.widgets.ResolutionNode.didResolve(ResolutionNode.java:70)
at android.support.constraint.solver.widgets.ResolutionAnchor.resolve(ResolutionAnchor.java:140)
at android.support.constraint.solver.widgets.ResolutionNode.didResolve(ResolutionNode.java:71)
at android.support.constraint.solver.widgets.ResolutionAnchor.resolve(ResolutionAnchor.java:140)
----A lot of identical lines----
at android.support.constraint.solver.widgets.ResolutionNode.didResolve(ResolutionNode.java:71)
at android.support.constraint.solver.widgets.ResolutionAnchor.resolve(ResolutionAnchor.java:85)
at android.support.constraint.solver.widgets.ConstraintWidgetContainer.solveGraph(ConstraintWidgetContainer.java:586)
at android.support.constraint.solver.widgets.ConstraintWidgetContainer.optimize(ConstraintWidgetContainer.java:643)
at android.support.constraint.solver.widgets.ConstraintWidgetContainer.layout(ConstraintWidgetContainer.java:328)
at android.support.constraint.ConstraintLayout.solveLinearSystem(ConstraintLayout.java:1860)
at android.support.constraint.ConstraintLayout.onMeasure(ConstraintLayout.java:1621)
at android.view.View.measure(View.java:16749)
at android.widget.ScrollView.measureChildWithMargins(ScrollView.java:1235)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.widget.ScrollView.onMeasure(ScrollView.java:327)
at android.view.View.measure(View.java:16749)
at android.support.constraint.ConstraintLayout.internalMeasureChildren(ConstraintLayout.java:1227)
at android.support.constraint.ConstraintLayout.onMeasure(ConstraintLayout.java:1572)
at android.view.View.measure(View.java:16749)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5295)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:143)
at android.view.View.measure(View.java:16749)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5295)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1413)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:696)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:589)
at android.view.View.measure(View.java:16749)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5295)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.view.View.measure(View.java:16749)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5295)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1413)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:696)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:589)
at android.view.View.measure(View.java:16749)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5295)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2439)
at android.view.View.measure(View.java:16749)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2072)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1175)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1372)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1062)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5996)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
at android.view.Choreographer.doCallbacks(Choreographer.java:574)
at android.view.Choreographer.doFrame(Choreographer.java:544)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5590)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
at dalvik.system.NativeStart.main(NativeStart.java)


Please help me to find out the reason of that crash or at least how to reproduce it.



UPD:



With help of my users I found out a place, where crash happens. It's an activity, where layout is not inflated from xml but generated in onCreate() by code (ConstraintLayout as root).










share|improve this question
















I have multiple strange crash reports via Firebase Crashlytics during last week from different devices.
They are:



  • 100% from Android 4 (4.2 - 4.4)

  • Mostly (98%) from Samsung tablets

Stack traces are identical and doesn't include any reference to my code, so I dont know where crash happen and why. Searching for my exception gives nothing. So I hope somebody can help me investigating that crashes. As I understand, crash happen somewhere inside ConstraintLayout library (I use version 1.1.3).



Crash stack trace:



Fatal Exception: java.lang.StackOverflowError
at java.util.HashMap$KeySet.<init>(HashMap.java:911)
at java.util.HashMap$KeySet.<init>(HashMap.java:911)
at java.util.HashMap.keySet(HashMap.java:696)
at java.util.HashSet.iterator(HashSet.java:161)
at android.support.constraint.solver.widgets.ResolutionNode.didResolve(ResolutionNode.java:70)
at android.support.constraint.solver.widgets.ResolutionAnchor.resolve(ResolutionAnchor.java:140)
at android.support.constraint.solver.widgets.ResolutionNode.didResolve(ResolutionNode.java:71)
at android.support.constraint.solver.widgets.ResolutionAnchor.resolve(ResolutionAnchor.java:140)
----A lot of identical lines----
at android.support.constraint.solver.widgets.ResolutionNode.didResolve(ResolutionNode.java:71)
at android.support.constraint.solver.widgets.ResolutionAnchor.resolve(ResolutionAnchor.java:85)
at android.support.constraint.solver.widgets.ConstraintWidgetContainer.solveGraph(ConstraintWidgetContainer.java:586)
at android.support.constraint.solver.widgets.ConstraintWidgetContainer.optimize(ConstraintWidgetContainer.java:643)
at android.support.constraint.solver.widgets.ConstraintWidgetContainer.layout(ConstraintWidgetContainer.java:328)
at android.support.constraint.ConstraintLayout.solveLinearSystem(ConstraintLayout.java:1860)
at android.support.constraint.ConstraintLayout.onMeasure(ConstraintLayout.java:1621)
at android.view.View.measure(View.java:16749)
at android.widget.ScrollView.measureChildWithMargins(ScrollView.java:1235)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.widget.ScrollView.onMeasure(ScrollView.java:327)
at android.view.View.measure(View.java:16749)
at android.support.constraint.ConstraintLayout.internalMeasureChildren(ConstraintLayout.java:1227)
at android.support.constraint.ConstraintLayout.onMeasure(ConstraintLayout.java:1572)
at android.view.View.measure(View.java:16749)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5295)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:143)
at android.view.View.measure(View.java:16749)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5295)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1413)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:696)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:589)
at android.view.View.measure(View.java:16749)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5295)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.view.View.measure(View.java:16749)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5295)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1413)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:696)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:589)
at android.view.View.measure(View.java:16749)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5295)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2439)
at android.view.View.measure(View.java:16749)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2072)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1175)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1372)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1062)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5996)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
at android.view.Choreographer.doCallbacks(Choreographer.java:574)
at android.view.Choreographer.doFrame(Choreographer.java:544)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5590)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
at dalvik.system.NativeStart.main(NativeStart.java)


Please help me to find out the reason of that crash or at least how to reproduce it.



UPD:



With help of my users I found out a place, where crash happens. It's an activity, where layout is not inflated from xml but generated in onCreate() by code (ConstraintLayout as root).







android android-constraintlayout






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 15 '18 at 11:52







Andrei Vinogradov

















asked Oct 29 '18 at 13:37









Andrei VinogradovAndrei Vinogradov

768518




768518












  • Check if you have put some "difficult" constraints (e.g. circular).

    – Henry
    Oct 29 '18 at 14:19











  • No, all constraints are simple. Maximum "difficulty" - is using Barriers. It's sad, that I dont know how to reproduce that crash. And layout that cause it. Difficult constraints can cause such exception?

    – Andrei Vinogradov
    Oct 29 '18 at 14:22


















  • Check if you have put some "difficult" constraints (e.g. circular).

    – Henry
    Oct 29 '18 at 14:19











  • No, all constraints are simple. Maximum "difficulty" - is using Barriers. It's sad, that I dont know how to reproduce that crash. And layout that cause it. Difficult constraints can cause such exception?

    – Andrei Vinogradov
    Oct 29 '18 at 14:22

















Check if you have put some "difficult" constraints (e.g. circular).

– Henry
Oct 29 '18 at 14:19





Check if you have put some "difficult" constraints (e.g. circular).

– Henry
Oct 29 '18 at 14:19













No, all constraints are simple. Maximum "difficulty" - is using Barriers. It's sad, that I dont know how to reproduce that crash. And layout that cause it. Difficult constraints can cause such exception?

– Andrei Vinogradov
Oct 29 '18 at 14:22






No, all constraints are simple. Maximum "difficulty" - is using Barriers. It's sad, that I dont know how to reproduce that crash. And layout that cause it. Difficult constraints can cause such exception?

– Andrei Vinogradov
Oct 29 '18 at 14:22













1 Answer
1






active

oldest

votes


















0














Finally I found out what was the reason.



I have an activity, where some number of Views were added dynamically depending on list with data passed to activity and type of every item. They were added to ConstraintLayout inside ScrollView. Crash happen when number of added views exceed ~30.



Solution:
I switched to RecyclerView to do more effective drawing and optimize memory usage and problem gone. Do not repeat my mistake and use RecyclerView to display large lists. Main mistake was that I could not imagine case, where that list will be really large but here we are.



That does not explain why crash happen only on Samsung devices and only on Android 4.2-4.4, but anyway it is better solution to use RecyclerView.






share|improve this answer






















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53046700%2fconstraintlayout-crash-with-stackoverflowerror%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Finally I found out what was the reason.



    I have an activity, where some number of Views were added dynamically depending on list with data passed to activity and type of every item. They were added to ConstraintLayout inside ScrollView. Crash happen when number of added views exceed ~30.



    Solution:
    I switched to RecyclerView to do more effective drawing and optimize memory usage and problem gone. Do not repeat my mistake and use RecyclerView to display large lists. Main mistake was that I could not imagine case, where that list will be really large but here we are.



    That does not explain why crash happen only on Samsung devices and only on Android 4.2-4.4, but anyway it is better solution to use RecyclerView.






    share|improve this answer



























      0














      Finally I found out what was the reason.



      I have an activity, where some number of Views were added dynamically depending on list with data passed to activity and type of every item. They were added to ConstraintLayout inside ScrollView. Crash happen when number of added views exceed ~30.



      Solution:
      I switched to RecyclerView to do more effective drawing and optimize memory usage and problem gone. Do not repeat my mistake and use RecyclerView to display large lists. Main mistake was that I could not imagine case, where that list will be really large but here we are.



      That does not explain why crash happen only on Samsung devices and only on Android 4.2-4.4, but anyway it is better solution to use RecyclerView.






      share|improve this answer

























        0












        0








        0







        Finally I found out what was the reason.



        I have an activity, where some number of Views were added dynamically depending on list with data passed to activity and type of every item. They were added to ConstraintLayout inside ScrollView. Crash happen when number of added views exceed ~30.



        Solution:
        I switched to RecyclerView to do more effective drawing and optimize memory usage and problem gone. Do not repeat my mistake and use RecyclerView to display large lists. Main mistake was that I could not imagine case, where that list will be really large but here we are.



        That does not explain why crash happen only on Samsung devices and only on Android 4.2-4.4, but anyway it is better solution to use RecyclerView.






        share|improve this answer













        Finally I found out what was the reason.



        I have an activity, where some number of Views were added dynamically depending on list with data passed to activity and type of every item. They were added to ConstraintLayout inside ScrollView. Crash happen when number of added views exceed ~30.



        Solution:
        I switched to RecyclerView to do more effective drawing and optimize memory usage and problem gone. Do not repeat my mistake and use RecyclerView to display large lists. Main mistake was that I could not imagine case, where that list will be really large but here we are.



        That does not explain why crash happen only on Samsung devices and only on Android 4.2-4.4, but anyway it is better solution to use RecyclerView.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 17 '18 at 13:15









        Andrei VinogradovAndrei Vinogradov

        768518




        768518





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53046700%2fconstraintlayout-crash-with-stackoverflowerror%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            這個網誌中的熱門文章

            How to read a connectionString WITH PROVIDER in .NET Core?

            Node.js Script on GitHub Pages or Amazon S3

            Museum of Modern and Contemporary Art of Trento and Rovereto