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

IllegalArgumentException px must be > 0. #2733

Open
AlexeyGodyaev opened this issue Dec 4, 2024 · 2 comments
Open

IllegalArgumentException px must be > 0. #2733

AlexeyGodyaev opened this issue Dec 4, 2024 · 2 comments
Labels
help wanted Issues that are up for grabs + are good candidates for community PRs

Comments

@AlexeyGodyaev
Copy link

<FrameLayout
     android:layout_width="match_parent" 
    android:layout_height="match_parent" >
    <androidx.appcompat.widget.AppCompatImageView
        android:id="@+id/background"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scaleType="centerCrop" />
     <androidx.appcompat.widget.AppCompatImageView
                android:id="@+id/icon"
                android:layout_width="38dp"
                android:layout_height="35.53dp"
                android:visibility="gone" />
</FrameLayout>

in onViewCreated

  binding?.background?.load(R.drawable.background) 

//delay any time

  binding?.icon?.visibility = View.VISIBLE
  binding?.icon?.load(R.drawable.icon)
image
@colinrtwhite colinrtwhite added the help wanted Issues that are up for grabs + are good candidates for community PRs label Jan 15, 2025
@colinrtwhite
Copy link
Member

colinrtwhite commented Jan 15, 2025

@AlexeyGodyaev What's the full stack trace? Also what version of Coil are you using? As of that latest version of Coil this doesn't seem to be possible as the two places that could throw this exception are guarded with > 0: https://github.com/coil-kt/coil/blob/main/coil-core/src/androidMain/kotlin/coil3/size/ViewSizeResolver.kt#L93

@AlexeyGodyaev
Copy link
Author

Crashed in non-app: coil3.size.Dimension$Pixels in constructor-impl
coil3.size.DimensionKt in Dimension at line 36
coil3.size.SizeKt in Size at line 36
com.______.MainActivity in onStart at line 508
Called from: android.app.Instrumentation in callActivityOnStart
android.app.Activity in performStart at line 8108
android.app.ActivityThread in handleStartActivity at line 3921
android.app.servertransaction.TransactionExecutor in performLifecycleSequence at line 235
android.app.servertransaction.TransactionExecutor in cycleToPath at line 215
android.app.servertransaction.TransactionExecutor in executeLifecycleState at line 187
android.app.servertransaction.TransactionExecutor in execute at line 105
android.app.ActivityThread$H in handleMessage at line 2473
android.os.Handler in dispatchMessage at line 110
android.os.Looper in loop at line 219
android.app.ActivityThread in main at line 8349
java.lang.reflect.Method in invoke
com.android.internal.os.RuntimeInit$MethodAndArgsCaller in run at line 513
com.android.internal.os.ZygoteInit in main at line 1055

io.coil-kt.coil3:coil-android | 3.0.4
io.coil-kt.coil3:coil-core-android | 3.0.4
io.coil-kt.coil3:coil-gif | 3.0.4
io.coil-kt.coil3:coil-network-core-android | 3.0.4
io.coil-kt.coil3:coil-network-okhttp-jvm | 3.0.4
io.coil-kt.coil3:coil-video | 3.0.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issues that are up for grabs + are good candidates for community PRs
Projects
None yet
Development

No branches or pull requests

2 participants