'Dalvik crash on Oneplus on Android 12

I've got an app in the play store, and have just started seeing the following crash on crashlytics as we're releasing a new version:

Fatal Exception: java.lang.VerifyError: Verifier rejected class app.models.basket.BasketPrice: app.models.pricing.Money app.models.basket.BasketPrice.component1() failed to verify: app.models.pricing.Money app.models.basket.BasketPrice.component1(): [0x2] return-wide not expected
app.models.pricing.Money app.models.basket.BasketPrice.component2() failed to verify: app.models.pricing.Money app.models.basket.BasketPrice.component2(): [0x2] return-wide not expected
app.models.pricing.Money app.models.basket.BasketPrice.component3() failed to verify: app.models.pricing.Money app.models.basket.BasketPrice.component3(): [0x2] return-wide not expected (declaration of 'app.models.basket.BasketPrice' appears in /data/app/~~SMvMJ3wjLcBZoO_7ATEdrA==/app-MRhsaTqPRxyDfq-Ma3jNMA==/base.apk)
       at app.models.basket.BasketPriceJsonAdapter.fromJson(BasketPriceJsonAdapter.kt:53)
       at app.models.basket.BasketPriceJsonAdapter.fromJson(BasketPriceJsonAdapter.kt:21)
       at com.squareup.moshi.internal.NullSafeJsonAdapter.fromJson(NullSafeJsonAdapter.java:41)
       at app.models.basket.BasketPricedFulfilmentOptionJsonAdapter.fromJson(BasketPricedFulfilmentOptionJsonAdapter.kt:57)
       at app.models.basket.BasketPricedFulfilmentOptionJsonAdapter.fromJson(BasketPricedFulfilmentOptionJsonAdapter.kt:22)
       at com.squareup.moshi.internal.NullSafeJsonAdapter.fromJson(NullSafeJsonAdapter.java:41)
       at app.models.basket.BasketPricedFulfilmentOptionsJsonAdapter.fromJson(BasketPricedFulfilmentOptionsJsonAdapter.kt:37)
       at app.models.basket.BasketPricedFulfilmentOptionsJsonAdapter.fromJson(BasketPricedFulfilmentOptionsJsonAdapter.kt:20)
       at com.squareup.moshi.internal.NullSafeJsonAdapter.fromJson(NullSafeJsonAdapter.java:41)
       at app.models.basket.BasketResponseJsonAdapter.fromJson(BasketResponseJsonAdapter.kt:79)
       at app.models.basket.BasketResponseJsonAdapter.fromJson(BasketResponseJsonAdapter.kt:24)
       at com.squareup.moshi.internal.NullSafeJsonAdapter.fromJson(NullSafeJsonAdapter.java:41)
       at app.models.DataWrapperJsonAdapter.fromJson(DataWrapperJsonAdapter.kt:44)
       at app.models.DataWrapperJsonAdapter.toJson(DataWrapperJsonAdapter.kt:22)
       at com.squareup.moshi.internal.NullSafeJsonAdapter.fromJson(NullSafeJsonAdapter.java:41)
       at retrofit2.converter.moshi.MoshiResponseBodyConverter.convert(MoshiResponseBodyConverter.java:46)
       at retrofit2.converter.moshi.MoshiResponseBodyConverter.convert(MoshiResponseBodyConverter.java:27)
       at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:243)
       at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:153)
       at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
       at java.lang.Thread.run(Thread.java:920)

I can't find anyone with this same return-wide not expected issue anywhere on the internet, although the VerifyError thing seems to be when the Dalvik runtime runs into issues.

My theory at the moment is that this is just a device specific issue for Oneplus Android 12 devices, but the stacktrace is in our(/Moshi) code, and it seems to only be on the new version, so I feel like there's some kind of aggravating factor. Can anyone say why this is happening?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source