kotlin-koans icon indicating copy to clipboard operation
kotlin-koans copied to clipboard

Starting single test in Android Studio 2.3 requires full rebuild

Open smdremedy opened this issue 7 years ago • 18 comments

Now that Kotlin is an official language for Android, can you fix this: https://discuss.kotlinlang.org/t/kotlin-koans/2808

I taught Kotlin last weekend to Android developers, and they had to call gradlew test after each change. Installing InteliJ just to do koans is a bit too much.

smdremedy avatar Jun 26 '17 12:06 smdremedy

Please vote and subscribe to this issue: https://youtrack.jetbrains.com/issue/KT-18948.

svtk avatar Jul 10 '17 12:07 svtk

I'm experiencing the same issue, and when I try to run a single unit test in Android Studio 3.0 Preview 2, I got this error:

Class not found: "i_introduction._0_Hello_World.N00StartKtTest"Empty test suite.

liangfenxiaodao avatar Aug 30 '17 00:08 liangfenxiaodao

@jackylimel Have you found solution for this issue? I am still facing it now

khalodark avatar Oct 03 '17 07:10 khalodark

not yet, I'm running the koans with Intellij Idea now

liangfenxiaodao avatar Oct 04 '17 05:10 liangfenxiaodao

I ran into the same problem after loading kotlin-koans into Android Studio 3.0. No solution found yet.

afaktor avatar Nov 21 '17 14:11 afaktor

I ran into the same problem after loading kotlin-koans into Android Studio 3.0. No solution found yet.

MahatmaSun avatar Nov 22 '17 09:11 MahatmaSun

See my case here:https://stackoverflow.com/a/47706652/5671221

tsunhua avatar Dec 08 '17 02:12 tsunhua

I ran into the same problem after loading kotlin-koans into Android Studio 3.0.1. No solution found yet.

lisongting avatar Dec 08 '17 09:12 lisongting

I ran into the same problem after loading kotlin-koans into Android Studio 3.0.1. as well. No solution found either.

KevCron avatar Jan 24 '18 19:01 KevCron

I found a solution in Android Studio 3.0.1, open Gradle panel, Tasks -> build -> testClasses. Wait complete, and run test

elrondliu avatar Jan 30 '18 04:01 elrondliu

I found a method to solve this problem.

2018-01-30_224732

After several seconds, then you will see something like this. 2018-01-30_224801

Click the left green button of every test class , then you can see whether your code is right or not. 2018-01-30_225330

lisongting avatar Jan 30 '18 15:01 lisongting

To be clear, once you perform the above :testClasses gradle task, you can right-click on each test file and run individual tests as expected.

The annoying part is that you need to run :testClasses each and every time you modify the kotlin koans and want to see updated results.

bstrathearn avatar Feb 02 '18 18:02 bstrathearn

That's really a major issue for anyone starting with Kotlin - it really leaves a bad first impression. You clone the Koans tutorial and you are stuck right in the beginning.

DanielNovak avatar Feb 19 '18 12:02 DanielNovak

See these Android Studio issues. Hopefully this will get fixed soon. For now I am working on the Koans in IntelliJ IDEA (Community Edition) and the experience is awesome. https://issuetracker.google.com/issues/78601041 https://issuetracker.google.com/issues/71694304

jimandreas avatar May 05 '18 08:05 jimandreas

If you edit the "Android JUnit" configuration under "Defaults" and add a gradle task to run before launch, you can run the testClasses task before each of the tests are run.

image

LDuncAndroid avatar May 16 '18 10:05 LDuncAndroid

Every time you make a change to a test you have to rerun the testClasses Gradle task. This is not obvious at all. Please add a disclaimer on the repo about this problem until it's resolved.

lawloretienne avatar Jun 04 '18 06:06 lawloretienne

Looks like this is still an issue nearly a year later. https://youtrack.jetbrains.com/issue/KT-18948

lawloretienne avatar Jun 04 '18 20:06 lawloretienne

I've ended up using https://kotlinlang.org/docs/tutorials/edu-tools-learner.html At least it works out of the box.

Dorrro avatar Jul 09 '18 20:07 Dorrro