I am using PaperParcel with Kotlin but i get a crash "java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.b.h.b, parameter schoolName"
I am passing data to some fragment in bundle and while receiving it throws the exception "java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.b.h.b, parameter schoolName"
java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.b.h.b, parameter schoolName
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2426)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2490)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1354)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Caused by: java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.b.h.b, parameter schoolName
at com.model.login.ProfileData.
Hey, could you please send the ProfileData class? I'll take a look
@Anmol92verma are you able to post that class, or alternatively some other code that demonstrates the issue?
@PaperParcel data class ProfileData( val id: String, @SerializedName("first_name") val firstName: String, @SerializedName("last_name") val lastName: String, @SerializedName("user_name") val userName: String, @SerializedName("email_id") val email: String, @SerializedName("school_name") val schoolName: String, @SerializedName("class_of") var classOf: String, var dob: String, val address: String, val city: String, val state: String, val zip: String, val country: String, @SerializedName("phone_number") val phoneNumber: String, val picture: String, var height: String, var isfavorite: Boolean, var isInTeam: Boolean, val status: String, val website: String, val cover: String, @SerializedName("user_type") val userType: String, @SerializedName("graduation_year") var graduationYear: String, var weight: String, val team: String, val position: String, val sport: String, var gender: String, @SerializedName("created") val profileCreatedAt: String, @SerializedName("modified") val profileLastModifiedAt: String, @SerializedName("player_number") val playerNumber: String, @SerializedName("isFollowing") var isfollow: Boolean, @SerializedName("followedByCount") var followedByCount: String, @SerializedName("followingCount") val followingCount: String, @SerializedName("sport_p") var sportModel: AttributeData, @SerializedName("playerAttributes") val playerAttributes: ArrayList<AttributeResponse>, @SerializedName("tptUrls") val tptUrls: HashMap<String, ArrayList<TptUrl>>,
@SerializedName("about_me")
val aboutMe: Stats,
@SerializedName("goal")
val goal: Stats,
@SerializedName("notification_status")
val notificationStatus: Boolean,
@SerializedName("favSports")
val favSports: ArrayList<AttributeData>,
@SerializedName("showcase")
val showcase: ArrayList<ShowcaseResponse>,
@SerializedName("favProfessionalTeams")
val favProfessionalTeams: ArrayList<AttributeData>,
@SerializedName("favColleges")
val favColleges: ArrayList<AttributeData>,
@SerializedName("favApparel")
val favApparel: ArrayList<AttributeData>,
@SerializedName("favMusic")
val favMusic: ArrayList<AttributeData>,
@SerializedName("favFitnessCenter")
val favFitnessCenter: ArrayList<AttributeData>,
@SerializedName("favActivities")
val favActivities: ArrayList<AttributeData>,
@SerializedName("workout")
val workouts: ArrayList<AllMediaProfile>,
@SerializedName("media")
val media: ArrayList<AllMediaProfile>,
@SerializedName("coaches")
val coachesList: ArrayList<CoachesBody>,
@SerializedName("favUsers")
val favUsers: ArrayList<Player>,
@SerializedName("myTeam")
val myTeam: MyTeam?,
val isblockedByMe: Boolean,
val imBlockedBy: Boolean,
val verified: Boolean,
val postPermit: Boolean) : PaperParcelable {
companion object {
@JvmField val CREATOR = PaperParcelProfileData.CREATOR
}
}
Hello.
I have the same problem. I see this error when I'm building the release project with proguard.
Have you got a solution?
@Slik1002 you won't need any special proguard rules for this library. It sounds as though you have a kotlin model, but it's being instantiated incorrectly (probably through the usage of Gson or Moshi). Just a guess!
If that is the case, then your model object was instantiated with a null value in a non-nullable field, then that null value got Parcelled, then my library tried to unparcel it. At that point kotlin throws an exception because that field should never have been null in the first place.
same problem here java.lang.IllegalArgumentException: Parameter specified as non-null is null: method g.z.c.h.f, parameter msg