'Modules that need to be instantiated by Hilt must have a visible, empty constructor

@Module
@InstallIn(SingletonComponent::class)
class WheelModule constructor(val size:Int) {

    @Provides
    fun provideWheel():Wheel = Wheel(size)

}

Modules that need to be instantiated by Hilt must have a visible, empty constructor. [Hilt] Processing did not complete. See error above for details.



Solution 1:[1]

@Module

@InstallIn(SingletonComponent::class)

class WheelModule() {

@Inject val size: Int=0

@Provides
fun provideWheel():Wheel = Wheel(size)

}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1