Can not find how can I turn off the deprecation wa...
# k2-adopters
e
Can not find how can I turn off the deprecation warnings with 2.1 - hovering with mouse doesn't who me the value for the compiler. (I'm in Android Studio).
d
About which specific warnings you are talking about?
e
That are marked with deprecation annotation
Example
Copy code
'fun <reified VM : ViewModel> Fragment.providingSavedStateActivityViewModels(crossinline provider: (SavedStateHandle) -> VM): Lazy<VM>' is deprecated. Use Fragment.viewModels((() -> String)?, () -> ViewModelStoreOwner, MutableCreationExtras.() -> Unit, () -> Bundle, (() -> ViewModelProvider.Factory)?) with requireActivity() as view model store owner and in combination with InitializerViewModelFactoryBuilder and CreationExtras.createSavedStateHandle().
d
Ah, it's not a language deprecation, but from some library
@Suppress("DEPRECATION")
e
Yeah, is it supported?
d
Did you try?
e
I would love to. But what is option for that specific warning?
Copy code
freeCompilerArgs.add("-Xsuppress-warning=<?>")
Maybe
DEPRECATION
?
👌 1
Yup, tried with this guess and it works!
👍 1