bumptech / glide

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

VerifyError on Glide in Android devices running 4.3 #4191

Closed Javinator9889 closed 4 years ago

Javinator9889 commented 4 years ago

Glide Version: 4.11.0

Integration libraries: none

Device/Android Version: Google Play Android test device Samsung Galaxy S3 running Android 4.3 - https://play.google.com/apps/publish/?account=5245190277294621651#DeviceCatalogPlace:p=com.javinator9889.handwashingreminder&deviceId=m0&originPlace=PRE_LAUNCH_REPORT_PAGE

Issue details / Repro steps / Use case background: When tarageting other devices with an SDK higher than 19 (or 20) this error is not happening (VerifyError), but while doing test those devices (Android 4.3) fails running.

Glide load line / GlideModule (if any) / list Adapter code (if any):

GlideApp.with(this)
    .load(imageRes)
    .centerInside()
    .into(image)

Tried with simple "Glide" but it doesn't work either.

Layout XML:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <com.google.android.material.card.MaterialCardView
        android:id="@+id/timeCard"
        style="@style/Widget.MaterialComponents.CardView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="8dp"
        android:layout_marginStart="8dp"
        android:layout_marginLeft="8dp"
        android:layout_marginTop="8dp"
        android:layout_marginEnd="8dp"
        android:layout_marginRight="8dp"
        android:checkable="true"
        android:clickable="true"
        android:focusable="true"
        android:minHeight="0dp"
        android:padding="8dp"
        android:visibility="visible"
        app:cardCornerRadius="16dp"
        app:cardElevation="4dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintStart_toStartOf="parent">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <TextView
                android:id="@+id/title"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginStart="16dp"
                android:layout_marginTop="16dp"
                android:layout_marginEnd="16dp"
                android:textAppearance="@style/TextAppearance.AppCompat.Large"
                app:fontFamily="@font/roboto"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginStart="8dp"
                android:layout_marginLeft="8dp"
                android:layout_marginTop="8dp"
                android:layout_marginEnd="8dp"
                android:layout_marginRight="8dp"
                android:layout_marginBottom="16dp"
                android:orientation="horizontal"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/title">

                <com.javinator9889.handwashingreminder.graphics.RecyclingImageView
                    android:id="@+id/infoImage"
                    android:layout_width="0dp"
                    android:layout_height="150dp"
                    android:layout_gravity="center"
                    android:layout_margin="8dp"
                    android:layout_weight="1"
                    android:contentDescription="TODO"
                    android:layout_marginEnd="16dp"
                    app:srcCompat="@drawable/ic_breakfast" />

                <androidx.constraintlayout.widget.ConstraintLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:layout_marginStart="16dp"
                    android:layout_marginLeft="16dp"
                    android:layout_marginEnd="16dp"
                    android:layout_marginRight="16dp"
                    android:gravity="center_vertical">

                    <com.mikepenz.iconics.view.IconicsImageView
                        android:id="@+id/clockIcon"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginEnd="8dp"
                        android:tint="@color/dkgray"
                        app:iiv_color="@color/dkgray"
                        app:iiv_icon="ion_android_time"
                        app:iiv_size="16dp"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintEnd_toStartOf="@+id/hours"
                        app:layout_constraintTop_toTopOf="parent" />

                    <TextView
                        android:id="@+id/hours"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:autofillHints=""
                        android:clickable="true"
                        android:ellipsize="end"
                        android:focusable="true"
                        android:gravity="center"
                        android:hint="@string/hours_abbrev"
                        android:maxLength="2"
                        android:maxLines="1"
                        android:singleLine="true"
                        android:textSize="18sp"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintEnd_toStartOf="@+id/ddot"
                        app:layout_constraintStart_toEndOf="@+id/clockIcon"
                        app:layout_constraintHorizontal_bias="0.0"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toTopOf="parent" />

                    <TextView
                        android:id="@+id/ddot"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="1dp"
                        android:layout_marginLeft="1dp"
                        android:layout_marginTop="8dp"
                        android:layout_marginEnd="1dp"
                        android:layout_marginRight="1dp"
                        android:layout_marginBottom="8dp"
                        android:text="@string/double_dot"
                        android:textSize="18sp"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintEnd_toStartOf="@+id/minutes"
                        app:layout_constraintStart_toEndOf="@+id/hours"
                        app:layout_constraintTop_toTopOf="parent" />

                    <TextView
                        android:id="@+id/minutes"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:autofillHints=""
                        android:gravity="center"
                        android:hint="@string/minutes_abbrev"
                        android:maxLength="2"
                        android:maxLines="1"
                        android:singleLine="true"
                        android:textSize="18sp"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toEndOf="@+id/ddot"
                        app:layout_constraintTop_toTopOf="parent" />
                </androidx.constraintlayout.widget.ConstraintLayout>

            </LinearLayout>

        </androidx.constraintlayout.widget.ConstraintLayout>

    </com.google.android.material.card.MaterialCardView>

</LinearLayout>

Stack trace / LogCat:

java.lang.VerifyError: n0/d/a/w/o/u
    at com.bumptech.glide.Glide.<init>(Glide.java:428)
    at com.bumptech.glide.GlideBuilder.build(GlideBuilder.java:564)
    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:860)
    at com.javinator9889.handwashingreminder.graphics.GlideApp.with(GlideApp.java:127)
    at com.javinator9889.handwashingreminder.appintro.timeconfig.TimeConfigViewHolder.loadImageView(TimeConfigViewHolder.java:115)
    at com.javinator9889.handwashingreminder.appintro.timeconfig.TimeConfigViewHolder.bind(TimeConfigViewHolder.java:92)
    at com.javinator9889.handwashingreminder.appintro.timeconfig.TimeConfigAdapter.onBindViewHolder(TimeConfigAdapter.java:51)
    at com.javinator9889.handwashingreminder.appintro.timeconfig.TimeConfigAdapter.onBindViewHolder(TimeConfigAdapter.java:30)
    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.dispatchLayout(RecyclerView.java:3851)
    at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4404)
    at android.view.View.layout(View.java:15204)
    at android.view.ViewGroup.layout(ViewGroup.java:4793)
    at androidx.constraintlayout.widget.ConstraintLayout.onLayout(ConstraintLayout.java:1656)
    at android.view.View.layout(View.java:15204)
    at android.view.ViewGroup.layout(ViewGroup.java:4793)
    at androidx.viewpager.widget.ViewPager.onLayout(ViewPager.java:1775)
    at android.view.View.layout(View.java:15204)
    at android.view.ViewGroup.layout(ViewGroup.java:4793)
    at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1076)
    at android.view.View.layout(View.java:15204)
    at android.view.ViewGroup.layout(ViewGroup.java:4793)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
    at android.view.View.layout(View.java:15204)
    at android.view.ViewGroup.layout(ViewGroup.java:4793)
    at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1677)
    at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1531)
    at android.widget.LinearLayout.onLayout(LinearLayout.java:1440)
    at android.view.View.layout(View.java:15204)
    at android.view.ViewGroup.layout(ViewGroup.java:4793)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
    at android.view.View.layout(View.java:15204)
    at android.view.ViewGroup.layout(ViewGroup.java:4793)
    at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1677)
    at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1531)
    at android.widget.LinearLayout.onLayout(LinearLayout.java:1440)
    at android.view.View.layout(View.java:15204)
    at android.view.ViewGroup.layout(ViewGroup.java:4793)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
    at android.view.View.layout(View.java:15204)
    at android.view.ViewGroup.layout(ViewGroup.java:4793)
    at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2260)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2007)
    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1249)
    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6364)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:791)
    at android.view.Choreographer.doCallbacks(Choreographer.java:591)
    at android.view.Choreographer.doFrame(Choreographer.java:561)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:777)
    at android.os.Handler.handleCallback(Handler.java:730)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:176)
    at android.app.ActivityThread.main(ActivityThread.java:5419)
    at java.lang.reflect.Method.invokeNative(Method.java)
    at java.lang.reflect.Method.invoke(Method.java:525)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
    at dalvik.system.NativeStart.main(NativeStart.java)

crash-android4.mp4.gz https://youtu.be/b5pP1Ehcg_c

Source code available here: https://gitlab.javinator9889.com/Javinator9889/handwashing-reminder

sjudd commented 4 years ago

Here's the problematic line: https://github.com/bumptech/glide/blob/cd72124f6fd124d88f4fe85d503e6b22e1f84b1b/library/src/main/java/com/bumptech/glide/Glide.java#L428

The change to add ParcelFileDescriptor decoding originally broke API 16-19, but a fix was submitted prior to 4.11 being released: https://github.com/bumptech/glide/commit/9281d8ed45591279b5fe646b136c956624a5da24.

Just to check, you're saying this error is specific to this particular device? If so I could imagine there being some weirdness with the indirection around the sdk check.

Javinator9889 commented 4 years ago

Here's the problematic line:

https://github.com/bumptech/glide/blob/cd72124f6fd124d88f4fe85d503e6b22e1f84b1b/library/src/main/java/com/bumptech/glide/Glide.java#L428

The change to add ParcelFileDescriptor decoding originally broke API 16-19, but a fix was submitted prior to 4.11 being released: 9281d8e.

Just to check, you're saying this error is specific to this particular device? If so I could imagine there being some weirdness with the indirection around the sdk check.

Great news! I could solve this problem with the solution to the issue #4177