https://kotlinlang.org logo
#android
Title
# android
j

jw

12/18/2017, 8:00 PM
Copy code
$ gw tasks --all | grep UnitTestKotlin
220:compileDebugUnitTestKotlin - Compiles the debugUnitTest kotlin.
229:compileReleaseUnitTestKotlin - Compiles the releaseUnitTest kotlin.
👍 1
h

hp

12/18/2017, 8:04 PM
Thanks! The task indeed shows up here. For context, I am trying to add step 7 of the Spek guide and it keeps failing to build from Android Studio (command line builds work fine) with
'compileReleaseUnitTestKotlin' not found in project ':app'.
. https://github.com/spekframework/spek/commit/e659eb633928f74cc52480e734ab6155dc310656#diff-ca39323a0256459cef092155304ed5ae
j

jw

12/18/2017, 8:05 PM
Android Studio can only treat one variant as active at a time
By default, this is the 'debug' variant of every module
If you open the "Build Variants" tool window (lower left, usually) you can switch it to 'release' and the task will probably then work
h

hp

12/18/2017, 8:08 PM
That makes sense! So I probably won’t be able to have the task that runs on both release and debug variants in my build file. I’ll just modify it so that only the debug tasks are run for now. Thank you very much for your help!
8 Views