I developed an android app using kotlin, and when I decompiled my code, in the smali file, I saw a lot of this.
/a/l.smali:61: const-string v5, "null cannot be cast to non-null type java.lang.Class<T of kotlin.jvm.JvmClassMappingKt.<get-java>>"
/a/l.smali:135: const-string v0, "null cannot be cast to non-null type T of androidx.lifecycle.ViewModelProvider.get"
/b1/b.smali:192: const-string v1, "null cannot be cast to non-null type android.view.WindowManager"
/c/d.smali:421: const-string p1, "null cannot be cast to non-null type T of androidx.lifecycle.ViewModelProvider.get"
/d1/m.smali:53: const-string v2, "null cannot be cast to non-null type android.content.ClipboardManager"
/d1/o.smali:135: const-string v4, "null cannot be cast to non-null type cn.lalaki.desk.m.AppDetails"
/d2/e.smali:495: const-string v3, "null cannot be cast to non-null type kotlin.Array<kotlin.Any?>"
I understand all this due to my use of forced transformations.
kotlin automatically generates many of these strings.
These error logs are thrown when a program error occurs.
But for the production environment, I don’t need these strings, is there any way to replace them with empty ones?
I don’t have any ideas right now, maybe I can just change the code and try not to use as to convert types, but if … is Type.
user25459605 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.