ClassNotFoundException in custom flavor using kotlin
问题 I defined my own flavor and set sourceSet: sourceSets { main.java.srcDirs += 'src/main/kotlin' // WORKS myflavor.java.srcDirs += 'src/myflavor/kotlin' // DOESN'T WORK } here is my project structure: but... I receive following error: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{xyz/xyz.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "xyz.MainActivity" on path: DexPathList[[zip file "/data/app/xyz/base.apk"],nativeLibraryDirectories=[/vendor/lib,