1

I'm running my app in Kotlin and there is no error, but I keep getting these warnings:

W/app: Got a deoptimization request on un-deoptimizable method boolean libcore.io.Linux.access(java.lang.String, int) W/app: Got a deoptimization request on un-deoptimizable method java.lang.Class java.lang.Class.classForName(java.lang.String, boolean, java.lang.ClassLoader) W/app: Got a deoptimization request on un-deoptimizable method boolean libcore.io.Linux.access(java.lang.String, int)

I wonder if this is something that will make my app crash in the future and if there is anything I could do to avoid it.

1 Answers1

-2

It looks like you’re getting warnings when building your Kotlin Android app. These warnings are not errors and they won’t make your app crash. However, it’s still a good idea to address them as they might indicate potential issues with your code.

One way to address these warnings is to make the Kotlin compiler treat warnings as errors. You can do this by adding the following code inside the allprojects block of your project-level build.gradle file:

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions.allWarningsAsErrors = true

}

Osam Alek
  • 7
  • 3
  • thank you. with this option I can't run the code, I get this error: "Caused by: org.jetbrains.kotlin.gradle.tasks.CompilationErrorException: Compilation error. See log for more details". do you know where that log is? – Harmony Valley Mar 27 '23 at 13:18