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

[BUG] Image.kt cropCameraPreviewToViewFinder crash #7915

Open
alashow opened this issue Feb 12, 2024 · 2 comments
Open

[BUG] Image.kt cropCameraPreviewToViewFinder crash #7915

alashow opened this issue Feb 12, 2024 · 2 comments
Assignees
Labels

Comments

@alashow
Copy link

alashow commented Feb 12, 2024

Summary

Re-opening #6116, since we're still seeing the crash on latest versions.

Code to reproduce

Simple usage, creating a scanner using CardScanSheet.create.
Cannot reproduce this manually, can see instances in Crashlytics (affecting ~125 users, 250 crashes).

Fatal Exception: java.lang.IllegalArgumentException: View finder Rect(0, 0 - 1080, 2195) is outside preview image bounds Rect(-9, 0 - 1089, 2194)
       at com.stripe.android.camera.framework.image.ImageKt.cropCameraPreviewToViewFinder(Image.kt:77)
       at com.stripe.android.stripecardscan.payment.ml.SSDOcr$Companion.cameraPreviewToInput(SSDOcr.kt:124)
       at com.stripe.android.stripecardscan.cardscan.CardScanFlow$startFlow$1$invokeSuspend$lambda$2$lambda$1$$inlined$map$1$2.emit(Emitters.kt:224)
       at kotlinx.coroutines.flow.FlowKt__ChannelsKt.emitAllImpl$FlowKt__ChannelsKt(Channels.kt:37)
       at kotlinx.coroutines.flow.FlowKt__ChannelsKt.access$emitAllImpl$FlowKt__ChannelsKt(Channels.kt)
       at kotlinx.coroutines.flow.FlowKt__ChannelsKt$emitAllImpl$1.invokeSuspend(Channels.kt:11)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
       at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt)

Android version & Impacted devices

Devices: Google, Samsung, Motorola
Android versions: Android 10-14 (probably can happen in all though)

Installation method

Gradle dependency

Dependency Versions

Stripe-android 20.35.0
kotlin 1.8.20
AGP 8.2.0
Gradle 8.0.0

SDK classes

CardScanSheet

@awush-stripe
Copy link
Collaborator

Thanks for the report, I'll be investigating this bug this week.

@tmgsoftart
Copy link

Same issue for me on stripe version 20.37.1
Fatal Exception: java.lang.IllegalArgumentException: View finder Rect(0, 0 - 1080, 2185) is outside preview image bounds Rect(-74, 0 - 1154, 2184) at com.stripe.android.camera.framework.image.ImageKt.cropCameraPreviewToViewFinder(Image.kt:77) at com.stripe.android.stripecardscan.payment.ml.SSDOcr$Companion.cameraPreviewToInput(SSDOcr.java:124) at com.stripe.android.stripecardscan.cardscan.CardScanFlow$startFlow$1$invokeSuspend$lambda$2$lambda$1$$inlined$map$1$2.emit(CardScanFlow.java:224) at kotlinx.coroutines.flow.FlowKt__ChannelsKt.emitAllImpl$FlowKt__ChannelsKt(FlowKt__Channels.kt:37) at kotlinx.coroutines.flow.FlowKt__ChannelsKt.access$emitAllImpl$FlowKt__ChannelsKt(FlowKt__Channels.kt:1) at kotlinx.coroutines.flow.FlowKt__ChannelsKt$emitAllImpl$1.invokeSuspend(Channels.kt:12) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.java:584) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)

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

No branches or pull requests

3 participants