5

I saw this crash over firebase and it is not reporducible in the emulator of same OS. Not sure what is causing it. Crash is occuring in samsung M32 OS 11.

The crash is

Caused by java.lang.RuntimeException: java.lang.ClassNotFoundException: com.octave.data.offer.Classes

This is the navigation graph

<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/offer_nav_graph"
app:startDestination="@id/offersFragment">

<fragment
    android:id="@+id/availableOfferDetailFragment"
    android:name="com.octave.offers.available.detail.AvailableOfferDetailFragment"
    android:label="fragment_available_offer_detail"
    tools:layout="@layout/fragment_available_offer_detail">
    <action
        android:id="@+id/action_availableOfferDetailFragment_to_applyOfferFragment"
        app:destination="@id/applyOfferFragment">
        <argument
            android:name="classes"
            app:argType="com.octave.data.offer.Classes[]" />
        <argument
            android:name="paymentPlans"
            app:argType="com.octave.data.offer.PaymentPlan[]" />
        <argument
            android:name="offerName"
            app:argType="string" />
    </action>
</fragment></navigation>

And my data classes are as follows

@Parcelize
data class Classes(
val id: Int,
val name: String,
val totalEquity: Int,
val reservedEquity: Int,
val expectedReturn: Float,
val subscribed: Int
):Parcelable

@Parcelize
data class PaymentPlan(
val id: String?=null,
val name: String,
var payment: Int,
val date: String
):Parcelable
WISHY
  • 11,067
  • 25
  • 105
  • 197

1 Answers1

4

It could be related to obfuscation. Here's a rule for any class annotated with @Parcelize:

-keep @kotlinx.parcelize.Parcelize public class *

Note it's for kotlinx.parcelize.Parcelize and not for the deprecated alternative kotlinx.android.parcel.Parcelize.

BtdJB
  • 41
  • 2