Skip to content

Crash when geometries are too complex to enconde in the QR code #3933

Description

@andreia-ferreira

Crashlytics

The QR code is missing error handling when the encoded data is too large. This could be due to geometries with many vertices or long LOI/survey names, which can make the geoJSON too big to be displayed as a QR code.

Fatal Exception: com.google.zxing.WriterException: Data too big
       at com.google.zxing.qrcode.encoder.Encoder.chooseVersion(Encoder.java:320)
       at com.google.zxing.qrcode.encoder.Encoder.recommendVersion(Encoder.java:218)
       at com.google.zxing.qrcode.encoder.Encoder.encode(Encoder.java:152)
       at com.google.zxing.qrcode.QRCodeWriter.encode(QRCodeWriter.java:78)
       at org.groundplatform.ui.components.qrcode.QrCodeGenerator_androidKt.encodeQrBitmap(QrCodeGenerator.android.kt:38)
       at org.groundplatform.ui.components.qrcode.GroundQrCodeKt$GroundQrCode$qrBitmap$2$1$1.invokeSuspend(GroundQrCode.kt:67)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
       at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:586)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:807)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:717)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:704)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Type

    Projects

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions