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

2.25.2 non-static method provideSpanCount() cannot be referenced from a static context #1694

Closed
Ethan1983 opened this issue Dec 14, 2019 · 1 comment

Comments

@Ethan1983
Copy link

Ethan1983 commented Dec 14, 2019

Updated dagger from 2.24 to 2.25.2 and tried removing @JvmStatic in kotlin object based modules. It works fine in all cases except this one. It fails with "error: non-static method provideSpanCount() cannot be referenced from a static context".

Note: @BindsInstance would work but the actual implementation of provideSpanCount takes context and returns a value at runtime. This example is just to reproduce.

@Module
object AppModule {

    @Provides
    fun provideSpanCount() : Int = 10
}

class SampleApp : DaggerApplication() {

    @Inject
    @JvmField
    var count : Int = 0
}
@bcorso
Copy link

bcorso commented Dec 16, 2019

I think this is a duplicate of issue #1648. This should be fixed now in 2.25.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants