getResourceDrawable not accessible after 3.5.0 upgrade (from 3.4.1)
sebastienrouif opened this issue · comments
Sebastien ROUIF commented
Steps to reproduce:
- setup a project using 3.4.1 and access
getResourceDrawable
it will build - upgrade to 3.5.0 function is not visible any more (still there in the code though)
Observed Results:
function is not found
Expected Results:
function should be accessible, visibility hasn't changed
Relevant Code:
// code here
PR with reproduction on Sample App
Konstantin Aksenov commented
3.5.0 ContextUtillsKt
// IntelliJ API Decompiler stub source generated from a class file
// Implementation of methods is not available
package io.github.kakaocup.kakao.common.utilities
public fun getResourceColor(@androidx.annotation.ColorRes resId: kotlin.Int): kotlin.Int { /* compiled code */ }
public fun getResourceDrawable(@androidx.annotation.DrawableRes resId: kotlin.Int): android.graphics.drawable.Drawable? { /* compiled code */ }
public fun getResourceString(@androidx.annotation.StringRes resId: kotlin.Int): kotlin.String { /* compiled code */ }
Konstantin Aksenov commented
@sebastienrouif thanks for reporting. Will try to fix in the next release
Konstantin Aksenov commented
Looks like issue related for Gradle configuration when functions declared without explicit classes
ContextUtills.kt
...
fun getResourceDrawable(@DrawableRes resId: Int) =
ContextCompat.getDrawable(InstrumentationRegistry.getInstrumentation().targetContext, resId)
...
Classes not found
However if
...
object ContextUtils {
...
fun getResourceDrawable(@DrawableRes resId: Int) =
ContextCompat.getDrawable(InstrumentationRegistry.getInstrumentation().targetContext, resId)
...
}
All works as expected
Konstantin Aksenov commented
Konstantin Aksenov commented