David Alford
05/24/2021, 10:16 PMval UByteArray.utf8:String
get() {
val index = this.indexOf(0u)
val cleaned = if (index == -1) {
{ this }()
}
else {
{ this.sliceArray(0 until index) }()
}
return cleaned.toByteArray().toString(Charsets.UTF_8)
}
Error Message:
com.android.tools.r8.errors.b: Field name '$this_<get-utf8>' cannot be represented in dex format.
ephemient
05/24/2021, 10:22 PMephemient
05/24/2021, 10:23 PMDavid Alford
05/24/2021, 10:25 PMephemient
05/24/2021, 10:25 PM@JvmName("getUtf8")
would work around itephemient
05/24/2021, 10:26 PMDavid Alford
05/24/2021, 10:27 PMephemient
05/24/2021, 10:33 PMephemient
05/24/2021, 10:34 PM@get:JvmName("getUtf8") val UByteArray.utf8: String get() = ...
or val UByteArray.utf8: String @JvmName("getUtf8") get() = ...
David Alford
05/24/2021, 10:34 PMDavid Alford
05/24/2021, 10:36 PMephemient
05/24/2021, 10:41 PMthis
(or extract them to a non-extension function, same thing)ephemient
05/24/2021, 10:43 PMephemient
05/24/2021, 10:45 PMval self = this
{ self }()
etc.David Alford
05/24/2021, 10:45 PMDavid Alford
05/24/2021, 10:56 PMephemient
05/24/2021, 10:59 PMthis
in a field. apparently that field is getting a name mangled in a way that isn't compatible with Android.