question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed resolution of: Landroidx/core/view/ViewCompat

See original GitHub issue

I’ve added FlexboxLayout to a layout xml file, and when I launch the Fragment that uses that layout file, I get the following:

java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/core/view/ViewCompat;
        at com.google.android.flexbox.FlexboxLayout.onLayout(FlexboxLayout.java:565)
        at android.view.View.layout(View.java:19586)
        at android.view.ViewGroup.layout(ViewGroup.java:6053)
        at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1080)
        at android.view.View.layout(View.java:19586)
        at android.view.ViewGroup.layout(ViewGroup.java:6053)
        at android.support.v7.widget.RecyclerView$LayoutManager.layoutDecoratedWithMargins(RecyclerView.java:9322)
        at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1615)
        at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1517)
        at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:612)
        at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3924)
        at android.support.v7.widget.RecyclerView.onMeasure(RecyclerView.java:3336)
        at android.view.View.measure(View.java:21998)
        at android.support.constraint.ConstraintLayout.internalMeasureChildren(ConstraintLayout.java:1180)
        at android.support.constraint.ConstraintLayout.onMeasure(ConstraintLayout.java:1249)
        at android.view.View.measure(View.java:21998)
        at android.widget.ScrollView.measureChildWithMargins(ScrollView.java:1308)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
        at android.widget.ScrollView.onMeasure(ScrollView.java:350)
        at android.view.View.measure(View.java:21998)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6580)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
        at android.view.View.measure(View.java:21998)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6580)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
        at android.view.View.measure(View.java:21998)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6580)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
        at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:143)
        at android.view.View.measure(View.java:21998)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6580)
        at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1514)
        at android.widget.LinearLayout.measureVertical(LinearLayout.java:806)
        at android.widget.LinearLayout.onMeasure(LinearLayout.java:685)
        at android.view.View.measure(View.java:21998)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6580)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
        at android.view.View.measure(View.java:21998)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6580)
        at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1514)
        at android.widget.LinearLayout.measureVertical(LinearLayout.java:806)
        at android.widget.LinearLayout.onMeasure(LinearLayout.java:685)
        at android.view.View.measure(View.java:21998)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6580)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
        at com.android.internal.policy.DecorView.onMeasure(DecorView.java:721)
        at android.view.View.measure(View.java:21998)
        at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2410)
        at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1498)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1751)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1386)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6733)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
        at android.view.Choreographer.doCallbacks(Choreographer.java:723)
        at android.view.Choreographer.doFrame(Choreographer.java:658)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
        at android.os.Handler.handleCallback(Handler.java:789)

Any idea what is happening here?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

48reactions
MGaetan89commented, Oct 8, 2018

Are you using AndroidX or the Support Libraries in your project? Flexbox 1.0.0 is meant to be used with the Support Libraries, Flexbox 1.1.0 is for AndroidX.

3reactions
MittapalliHareeshcommented, Oct 9, 2018

Thanks for the solution, due to there is no direct update at their github blog about versions everyone using 1.1.0 and facing this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed resolution of: Landroidx/core/view/MenuHost; - Stack ...
I found the problem while debugging. The problem was in andoidx.appcompat class not found. In app build.gradle, I changed this line of ...
Read more >
Failed resolution of: Landroidx/core/view ... - GitHub
Steps to Reproduce flutter run on the code sample Expected results: I want my status bar colour to change according to my code...
Read more >
Failed NoClassDefFoundError for android.view ... - Issue Tracker
I/zygote: Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$2>: java.lang.NoClassDefFoundError: Failed resolution ...
Read more >
Android Support到AndroidX的踩坑笔记_w366549434的博客
NoClassDefFoundError: Failed resolution of: Landroidx/core/content/ContextCompat经过一番查找,发现原来是因为android.support.
Read more >
rejecting re-init on previously-failed class viewcompat ...
failed resolution of: landroid/view/view$onunhandledkeyeventlistener ... Failed resolution of: Landroidx/core/content/contextcompat. Unity ID.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found