Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getResourceDrawable not accessible after 3.5.0 upgrade (from 3.4.1) #107

Open
sebastienrouif opened this issue Nov 30, 2023 · 5 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@sebastienrouif
Copy link
Contributor

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

@Vacxe Vacxe self-assigned this Jan 5, 2024
@Vacxe Vacxe added the bug Something isn't working label Jan 5, 2024
@Vacxe
Copy link
Member

Vacxe commented Jan 5, 2024

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


@Vacxe
Copy link
Member

Vacxe commented Jan 5, 2024

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

@Vacxe
Copy link
Member

Vacxe commented Jan 5, 2024

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

@Vacxe
Copy link
Member

Vacxe commented Jan 9, 2024

#112 + #114 should fix the issue

@Vacxe
Copy link
Member

Vacxe commented Jan 9, 2024

#106

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants