Here is the link
https://developer.android.com/studio/projects/add-kotlin
in which it says that if you want to split Kotlin files and Java files, then you need to add this
android { sourceSets { main.java.srcDirs += 'src/main/kotlin' } } I added and created the director
Added test class
class TestDeleteIt { fun test(iC: Context) = Toast.makeText(iC, "TTTEEESSSTTT", Toast.LENGTH_LONG).show() } And now I want to use it from Java class which is located in Java Directorate.
I write new TestDeleteIt() and he does not see it
The studio does not see such a directory. I added import kotlin.TestDeleteIt; the studio says there is no such directory
What did you do wrong?



import kotlin.TestDeleteIt;studio says there is no such package - Aleksey Timoshchenkopackage mypkg;for example (in this case, the coincidence of the package structure with the directory structure is not necessary, but is recommended in mixed projects). The package should be because Java does not support importing classes from the default package. - zRrr pm