diff --git a/kotlinx-coroutines-core/build.gradle b/kotlinx-coroutines-core/build.gradle index 451293c5ff..0222098405 100644 --- a/kotlinx-coroutines-core/build.gradle +++ b/kotlinx-coroutines-core/build.gradle @@ -55,6 +55,10 @@ compileKotlinMetadata { } kotlin.sourceSets { + jvm.dependencies { + compileOnly "com.google.android:annotations:4.1.1.4" + } + jvmTest.dependencies { api "org.jetbrains.kotlinx:lincheck:$lincheck_version" api "org.jetbrains.kotlinx:kotlinx-knit-test:$knit_version" diff --git a/kotlinx-coroutines-core/jvm/src/debug/AgentPremain.kt b/kotlinx-coroutines-core/jvm/src/debug/AgentPremain.kt index 6493077593..c4d6f530b7 100644 --- a/kotlinx-coroutines-core/jvm/src/debug/AgentPremain.kt +++ b/kotlinx-coroutines-core/jvm/src/debug/AgentPremain.kt @@ -9,8 +9,14 @@ import sun.misc.* import java.lang.instrument.* import java.lang.instrument.ClassFileTransformer import java.security.* +import android.annotation.* +/* + * This class is loaded if and only if kotlinx-coroutines-core was used as -javaagent argument, + * but Android complains anyway (java.lang.instrument.*), so we suppress all lint checks here + */ @Suppress("unused") +@SuppressLint("all") internal object AgentPremain { public var isInstalledStatically = false