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

Fatal Exception: java.lang.NoSuchMethodError: No interface method #97

Closed
tsuyoyo opened this issue Jul 8, 2021 · 12 comments · Fixed by #98
Closed

Fatal Exception: java.lang.NoSuchMethodError: No interface method #97

tsuyoyo opened this issue Jul 8, 2021 · 12 comments · Fixed by #98
Assignees
Labels
bug Something needs to be fixed

Comments

@tsuyoyo
Copy link

tsuyoyo commented Jul 8, 2021

Fatal Exception: java.lang.NoSuchMethodError: No interface method getOrDefault(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; in class Ljava/util/Map; or its super classes (declaration of 'java.util.Map' appears in /system/framework/core-libart.jar)
at com.kinnerapriyap.sugar.choice.MimeType$Companion.fromValue(MimeType.java:24)
at com.kinnerapriyap.sugar.mediagallery.media.MediaGalleryAdapter.onBindViewHolder(MediaGalleryAdapter.java:112)
at com.kinnerapriyap.sugar.mediagallery.media.MediaGalleryAdapter.(MediaGalleryAdapter.java:27)
at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:7065)
at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:7107)
at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:6012)
at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6279)
at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6118)
at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6114)
at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2303)
at androidx.recyclerview.widget.GridLayoutManager.layoutChunk(GridLayoutManager.java:561)
at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1587)
at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:665)
at androidx.recyclerview.widget.GridLayoutManager.onLayoutChildren(GridLayoutManager.java:170)
at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:4134)
at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:3851)
at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4404)
at android.view.View.layout(View.java:16651)
at android.view.ViewGroup.layout(ViewGroup.java:5441)
at androidx.constraintlayout.widget.ConstraintLayout.onLayout(ConstraintLayout.java:1855)
at android.view.View.layout(View.java:16651)
at android.view.ViewGroup.layout(ViewGroup.java:5441)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
at android.view.View.layout(View.java:16651)
at android.view.ViewGroup.layout(ViewGroup.java:5441)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
at android.view.View.layout(View.java:16651)
at android.view.ViewGroup.layout(ViewGroup.java:5441)
at androidx.constraintlayout.widget.ConstraintLayout.onLayout(ConstraintLayout.java:1855)
at android.view.View.layout(View.java:16651)
at android.view.ViewGroup.layout(ViewGroup.java:5441)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
at android.view.View.layout(View.java:16651)
at android.view.ViewGroup.layout(ViewGroup.java:5441)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1495)
at android.view.View.layout(View.java:16651)
at android.view.ViewGroup.layout(ViewGroup.java:5441)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
at android.view.View.layout(View.java:16651)
at android.view.ViewGroup.layout(ViewGroup.java:5441)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1495)
at android.view.View.layout(View.java:16651)
at android.view.ViewGroup.layout(ViewGroup.java:5441)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:2678)
at android.view.View.layout(View.java:16651)
at android.view.ViewGroup.layout(ViewGroup.java:5441)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2171)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1931)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
at android.view.Choreographer.doCallbacks(Choreographer.java:670)
at android.view.Choreographer.doFrame(Choreographer.java:606)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
at android.os.Handler.handleCallback(Handler.java:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5491)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)

@tsuyoyo
Copy link
Author

tsuyoyo commented Jul 8, 2021

@kinnerapriyap Can it be fixed?

@kinnerapriyap
Copy link
Owner

👀 Ahh might be an import issue, I can take a look this weekend. How often is this reproducible? @tsuyoyo

@kinnerapriyap kinnerapriyap self-assigned this Jul 8, 2021
@kinnerapriyap kinnerapriyap added the bug Something needs to be fixed label Jul 8, 2021
@tsuyoyo
Copy link
Author

tsuyoyo commented Jul 8, 2021

I don't reproduce it, but unfortunately it's most frequently happening crash in our app 😅

@kinnerapriyap
Copy link
Owner

kinnerapriyap commented Jul 9, 2021

Ohh I know what the error is, getOrDefault was added in API level 24 which causes it to crash in lower api devices. 🤔 It might be more reproducible in 21-23.

@tsuyoyo
Copy link
Author

tsuyoyo commented Jul 9, 2021

Ah exactly, it's happening only on 6.0/6.0.1

@tsuyoyo
Copy link
Author

tsuyoyo commented Jul 9, 2021

Is there any way to catch the exception?

@kinnerapriyap
Copy link
Owner

Yes! I think adding an extension function for getOrDefault and checking api level should solve the issue!

@kinnerapriyap
Copy link
Owner

I can make a fix this week and release 0.6.1 - also fixed the CI recently so I can also give you an update on the additional action we discussed soon! 🥳

@kinnerapriyap
Copy link
Owner

@tsuyoyo 0.6.1 is released with a fix, please reopen if the issue occurs again. Are there any other crashes that are currently happening?

@tsuyoyo
Copy link
Author

tsuyoyo commented Jul 16, 2021

Thank you!!

@kinnerapriyap
Copy link
Owner

@tsuyoyo Can you let me know if the issue is fixed? Thanks

@tsuyoyo
Copy link
Author

tsuyoyo commented Jul 28, 2021

Yes!! Thanks for addressing it!! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something needs to be fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants