KakaoCup / Kakao

Nice and simple DSL for Espresso in Kotlin

Home Page:https://kakaocup.github.io/Kakao/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

getResourceDrawable not accessible after 3.5.0 upgrade (from 3.4.1)

sebastienrouif opened this issue · comments

Steps to reproduce:

  1. setup a project using 3.4.1 and access getResourceDrawable it will build
  2. 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

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 */ }


@sebastienrouif thanks for reporting. Will try to fix in the next release

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

#112 + #114 should fix the issue