'The Suppress("OPT_IN_IS_NOT_ENABLED") doesn't work

After suppressing the OptIn warning, I was expecting it would go away, but it's still popping up after compile, any way to get rid of it?

@Suppress("OPT_IN_IS_NOT_ENABLED")
@OptIn(ExperimentalMaterialApi::class)

enter image description here



Solution 1:[1]

According to this question: How to set Opt in what resolves the problem is adding the following snippet to build.gradle (app)

kotlin.sourceSets.all {
    languageSettings.optIn("kotlin.RequiresOptIn")
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 David A