bumptech / glide

An image loading and caching library for Android focused on smooth scrolling
https://bumptech.github.io/glide/
Other
34.67k stars 6.12k forks source link

MemorySizeCalculator.java line 163 #4409

Open limaniarianit opened 3 years ago

limaniarianit commented 3 years ago

Hi there, We recently got 37 crashes in a matter of minutes from 2 users from this crash. Everything was working perfectly fine and we cant reproduce it. Any help or insight would be appreciated.

gradle: implementation 'com.github.bumptech.glide:glide:4.11.0'

Integration library: implementation 'com.android.volley:volley:1.1.1'

Devices: Galaxy A3(2016) Android: 7.0

Additional note (about the phone): Free space: 808mb, Free RAM 318 mb

View Hierarchy: Our HomeAdapter has 3 rows, one of which uses the glide:

... Usage of glide: class ViewHolder extends RecyclerView.ViewHolder { ViewHolder(View itemView) { super(itemView); } } private class SelectedItemHolder extends HomeAdapter.ViewHolder { RowTrainingPlanBinding binding; TrainingPlanHolder(View view) { super(view); binding = DataBindingUtil.bind(view); } public void bind(SelectedItem selectedItem) { SelectedItemViewModel temp = new SelectedItemViewModel(context, selectedItem); this.binding.setSelectedItemViewModel(temp); Glide.with(context).load(temp.getThumbnailImage()).transform(new CenterCrop(), new RoundedCorners(67)).into(binding.mainImage); this.binding.executePendingBindings(); } } StackTrace: Fatal Exception: java.lang.NoSuchMethodError: No direct method (Landroid/util/DisplayMetrics;)V in class Lcom/bumptech/glide/load/engine/cache/MemorySizeCalculator$DisplayMetricsScreenDimensions; or its super classes (declaration of 'com.bumptech.glide.load.engine.cache.MemorySizeCalculator$DisplayMetricsScreenDimensions' appears in base.apk) at com.bumptech.glide.load.engine.cache.MemorySizeCalculator$Builder.(MemorySizeCalculator.java:163) at com.bumptech.glide.GlideBuilder.build(GlideBuilder.java:515) at com.bumptech.glide.Glide.initializeGlide(Glide.java:290) at com.bumptech.glide.Glide.initializeGlide(Glide.java:242) at com.bumptech.glide.Glide.checkAndInitializeGlide(Glide.java:201) at com.bumptech.glide.Glide.get(Glide.java:182) at com.bumptech.glide.Glide.getRetriever(Glide.java:749) at com.bumptech.glide.Glide.with(Glide.java:776) at com.fitonomy.health.fitness.ui.home.HomeAdapter$TrainingPlanHolder.bind(HomeAdapter.java:426) at com.fitonomy.health.fitness.ui.home.HomeAdapter.onBindViewHolder(HomeAdapter.java:259) at com.fitonomy.health.fitness.ui.home.HomeAdapter.onBindViewHolder(HomeAdapter.java:44) 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.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1627) at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1587) at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:665) at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:4134) at androidx.recyclerview.widget.RecyclerView.onMeasure(RecyclerView.java:3540) at android.view.View.measure(View.java:21121) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6462) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464) at android.widget.LinearLayout.measureVertical(LinearLayout.java:758) at android.widget.LinearLayout.onMeasure(LinearLayout.java:640) at android.view.View.measure(View.java:21121) at androidx.constraintlayout.widget.ConstraintLayout$Measurer.measure(ConstraintLayout.java:763) at androidx.constraintlayout.solver.widgets.analyzer.BasicMeasure.measure(BasicMeasure.java:426) at androidx.constraintlayout.solver.widgets.analyzer.BasicMeasure.measureChildren(BasicMeasure.java:105) at androidx.constraintlayout.solver.widgets.analyzer.BasicMeasure.solverMeasure(BasicMeasure.java:247) at androidx.constraintlayout.solver.widgets.ConstraintWidgetContainer.measure(ConstraintWidgetContainer.java:117) at androidx.constraintlayout.widget.ConstraintLayout.resolveSystem(ConstraintLayout.java:1532) at androidx.constraintlayout.widget.ConstraintLayout.onMeasure(ConstraintLayout.java:1607) at android.view.View.measure(View.java:21121) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6462) at android.widget.FrameLayout.onMeasure(FrameLayout.java:185) at android.view.View.measure(View.java:21121) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6462) at android.widget.FrameLayout.onMeasure(FrameLayout.java:185) at android.view.View.measure(View.java:21121) at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715) at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461) at android.view.View.measure(View.java:21121) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6462) at android.widget.FrameLayout.onMeasure(FrameLayout.java:185) at androidx.appcompat.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:146) at android.view.View.measure(View.java:21121) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6462) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464) at android.widget.LinearLayout.measureVertical(LinearLayout.java:758) at android.widget.LinearLayout.onMeasure(LinearLayout.java:640) at android.view.View.measure(View.java:21121) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6462) at android.widget.FrameLayout.onMeasure(FrameLayout.java:185) at android.view.View.measure(View.java:21121) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6462) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464) at android.widget.LinearLayout.measureVertical(LinearLayout.java:758) at android.widget.LinearLayout.onMeasure(LinearLayout.java:640) at android.view.View.measure(View.java:21121) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6462) at android.widget.FrameLayout.onMeasure(FrameLayout.java:185) at com.android.internal.policy.DecorView.onMeasure(DecorView.java:872) at android.view.View.measure(View.java:21121) at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2625) at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1677) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1928) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1550) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7190) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:959) at android.view.Choreographer.doCallbacks(Choreographer.java:734) at android.view.Choreographer.doFrame(Choreographer.java:670) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:945) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6776) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386)
stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had activity in the last seven days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions.