https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
d

Derek Ellis

03/05/2021, 1:31 AM
I upgraded some dependencies and now when
check
is run
compileDebugAndroidTestKotlinAndroid
fails because it can't find the
actual
declaration for a JVM module. It worked before, and the actual declarations are there.. I can run
testDebugUnitTest
successfully too. Did something change or am I missing something obvious?
g

gammax

03/05/2021, 10:31 AM
I upgraded some dependencies
Which dependencies have you updated?
d

Derek Ellis

03/05/2021, 2:00 PM
I upgraded Kotlin to 1.4.31 from 1.4.21, and AGP to the latest alpha
g

gammax

03/05/2021, 2:42 PM
I see you’re using detekt. By any chance have you bumped it also? I’m asking since we shipped KMM support in the latest release.
Nope you haven’t, so that’s not #detekt related.
r

russhwolf

03/05/2021, 4:23 PM
I'm not sure exactly what causes it, but I've seen this in a kmp/compose project. It's looking for instrumentation test actuals. Copy your
actual
declarations from
androidTest
to
androidAndroidTest
and it will build.
👍 2
d

Derek Ellis

03/05/2021, 5:42 PM
That did the trick! I added the
androidTest
directory as the sourceset for
androidTest
to avoid having to copy/symlink the files and it seems to be working as well. Thank you! (and I'm going to bump detekt as well for good measure)
q

Qracle

02/25/2022, 11:19 PM
hi @Derek Ellis, do you mind sharing what you used to add the
androidTest
directory as the source set for
androidAndroidTest
?
d

Derek Ellis

02/26/2022, 1:48 PM
I used
java.srcDir
but I imagine
kotlin.srcDir
would work too https://github.com/cuhacking/mmapp/blob/main/mmapp/build.gradle.kts#L73-L79
🙏 1
2 Views