You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was implementing Kotify in an app and everything workedd correctly in debug mode. When i switched to release mode, it does not work. I have a try/catch that tris to do the code and then with an adapter i put it on the app and the catch returns another view in the app. In debug mode everything works correctly and the TRY is triggered. But in release, it triggers the CATCH meaning thatt the code has failed (api call)
CODE TRY CATCH
lifecycleScope.launch {
try {
val kotify = Kotify(
clientID = "5ef1e8a612cb4f12b3343ad26427ec93",
clientSecret = "6752b38c773741ea8e15404e613bea83"
)
val playlist: List<PlaylistPagination.Item> =
kotify.playlists.get("37i9dQZEVXbMDoHDwVN2tF").tracks.items
val tracks: ArrayList<Track> = playlist.map { it.track } as ArrayList<Track>
for (i in 0 until tracks.count()) {
val SEVERALartistsname: ArrayList<Artist> =
tracks[i].artists as ArrayList<Artist>
for (o in 0 until SEVERALartistsname.count()) {
if (artistname == null) {
artistname = SEVERALartistsname[o].name
} else {
artistname = artistname + ", " + SEVERALartistsname[o].name
}
}
val SEVERALalbumimg: ArrayList<Image> =
tracks[i].album?.images as ArrayList<Image>
val artworkTrack = SEVERALalbumimg[2].url
val songname = tracks[i].name ?: "N/A"
val nameartist = songname + System.lineSeparator() + artistname
courseList2.add(namespoty(i + 1, nameartist, artworkTrack))
SEVERALartistsname.clear()
artistname = null
}
val courseRVAdapter2 = CourseRVAdapter2(courseList2, true)
courseRV.adapter = courseRVAdapter2
loadingPB.visibility = View.GONE
} catch(e:Exception){
Log.i("HELLO", "CATCH")
loadingPB.visibility = View.GONE
Log.i("HELLO", "CATCH2")
courseList2.add(namespoty(null,"",""))
val courseRVAdapter2 = CourseRVAdapter2(courseList2, false)
Log.i("HELLO", "CATCH3")
courseRV.adapter = courseRVAdapter2
Log.i("HELLO", "CATCHEND")
}
it has to do with the relase mode and a thing to mention is that i have the proguard rules activated and i dont now if i have to add a rule excluding and which one! I would help a lot!
Your work is awesome! (take into account that is release mode and i dont have the logcat to see wheres the error so im stuck)
The text was updated successfully, but these errors were encountered:
I was implementing Kotify in an app and everything workedd correctly in debug mode. When i switched to release mode, it does not work. I have a try/catch that tris to do the code and then with an adapter i put it on the app and the catch returns another view in the app. In debug mode everything works correctly and the TRY is triggered. But in release, it triggers the CATCH meaning thatt the code has failed (api call)
CODE TRY CATCH
it has to do with the relase mode and a thing to mention is that i have the proguard rules activated and i dont now if i have to add a rule excluding and which one! I would help a lot!
Your work is awesome! (take into account that is release mode and i dont have the logcat to see wheres the error so im stuck)
The text was updated successfully, but these errors were encountered: