<Get kotlin class failed with dynamic string but w...
# stackoverflow
u
Get kotlin class failed with dynamic string but works with constant I just call a method class through this line : val instance = Class.forName(nameClass).kotlin.objectInstance When I set the nameClass with a constant value (see below) it's work. private const val PROVIDER_CLASS = "com.abc.xyz.feature.DynamicFeatureImpl\$Provider" fun method() { val instance = Class.forName(PROVIDER_CLASS).kotlin.objectInstance } But, when I set the nameClass to string (not constant), like this fun method() { val nameClass =...