I created my app and the app is working correctly in debug mode.after obfuscating a part of application that get codes list and shows in recyclerview not working properly in this fragment I am going to get the codes list-codes is my parcelable models class-but the main thread lock and nothing works I tried to prevent obfuscate this class but it still does not work correctly. I cant debug my released app to find the problem please help me to find problem or debug the released apk
this is my codes:
the codes model class:
class Codes(
@SerializedName("id")
var id: String?,
@SerializedName("title")
var title: String?,
@SerializedName("text")
var text: String?,
@SerializedName("codes")
var codes: String?,
@SerializedName("date")
var date: String?,
@SerializedName("codeId")
var codeId: String?,
@SerializedName("point")
var point: Int,
@SerializedName("name")
var name: String?,
@SerializedName("family")
var family: String?,
@SerializedName("image")
var image: String?,
@SerializedName("jensiat")
var jensiat: Int
) : Parcelable {
constructor(parcel: Parcel) : this(
parcel.readString(),
parcel.readString(),
parcel.readString(),
parcel.readString(),
parcel.readString(),
parcel.readString(),
parcel.readInt(),
parcel.readString(),
parcel.readString(),
parcel.readString(),
parcel.readInt()
) {
}
override fun writeToParcel(parcel: Parcel, flags: Int) {
parcel.writeString(id)
parcel.writeString(title)
parcel.writeString(text)
parcel.writeString(codes)
parcel.writeString(date)
parcel.writeString(codeId)
parcel.writeInt(point)
parcel.writeString(name)
parcel.writeString(family)
parcel.writeString(image)
parcel.writeInt(jensiat)
}
override fun describeContents(): Int {
return 0
}
companion object CREATOR : Parcelable.Creator<Codes> {
override fun createFromParcel(parcel: Parcel): Codes {
return Codes(parcel)
}
override fun newArray(size: Int): Array<Codes?> {
return arrayOfNulls(size)
}
}
}
codes fragment(where I get the List and show in recyclerview):
viewModel.getAllCodes(SORT_POPULAR).observe(this, Observer {
myList = it
Utils.customAnimation(recycler, animation = Techniques.Landing)
codeAdapter = CodeAdapter(context!!, it) { codeId, position ->
Log.i("LOG","code id:$codeId and position is: $position")
var transaction = activity!!.supportFragmentManager.beginTransaction()
lastPosition = position
var detailCodeFragment = DetailCodeFragment {
codeAdapter.changePoint(it)
}
var selectedCode: Codes? = null
for (i in 0 until myList.size) {
var id = myList[i].codeId
if (id == codeId) {
selectedCode = myList[i]
}
}
var bundle = Bundle()
bundle.putParcelable("codes", selectedCode)
bundle.putInt("position", lastPosition)
detailCodeFragment.arguments = bundle
Utils.customAnimation(
activity!!.findViewById(R.id.main_fragment_frame),
animation = Techniques.SlideInRight
)
transaction.add(R.id.main_fragment_frame, detailCodeFragment)
transaction.addToBackStack(null)
transaction.commit()
}
recycler.adapter = codeAdapter
loadingFragme.visibility = View.GONE
})
}
proguard rules:
-keepattributes Signature
# For using GSON @Expose annotation
-keepattributes *Annotation*
# Gson specific classes
-keep class sun.misc.Unsafe { *; }
#-keep class com.google.gson.stream.** { *; }
# Application classes that will be serialized/deserialized over Gson
-keep class com.google.gson.examples.android.model.** { *; }
##---------------End: proguard configuration for Gson ----------
-keepclassmembers class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
-keepclassmembers class * implements android.os.Parcelable {
public static final <fields>;
}