I’ve been trying to figure this out all day. I hav...
# multiplatform
b
I’ve been trying to figure this out all day. I have 2 libraries, library A and library B. In library B I have a source set
androidUnitTest
that contains a class. I then import library B into library A and add it as a dependency e.g.
androidUnitTest.dependencies { implementation(projects.libraryB) }
. library A can not see the class that I have in library B no matter what I try. Is this a KMP limitation? I’ve tried many different suggestions around here
I’ve tried these things
Copy code
kotlin {
  androidTarget {
    unitTestVariant.sourceSetTree.set(KotlinSourceSetTree.test)
  }
}
Plus this
Copy code
android {
  sourceSets["test"].kotlin.srcDir("src/androidUnitTest/kotlin")
}
Plus trying to create a normal Android library and not a KMP one.
w
I think you're looking for test fixtures? A module can't see another module's test classes, as far as I know.
b
I’ll do some more reading. I read some of that earlier but I’m not sure it’s supported on KMP yet. Although I only need it for Android so I may be able to work around that
e
oh Android makes it harder