Kotlin only robolectric_test targets fail to compile
See original GitHub issueThe following error appears when trying to compile a robolectric_test
target that contains only kotlin code:
2017-08-28 17:07:31.143][error][command:null][tid:217][com.facebook.buck.cli.Main] Uncaught exception at top level
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Building rule [//features/check-balance:test_debug#testsjar] failed. Caused by [NoSuchFileException]:
/Users/cwoodward/Development/project/buck-out/gen/features/check-balance/lib__test_debug#testsjar__output/used-classes.json
at com.facebook.buck.command.Build.executeAndPrintFailuresToEventBus(Build.java:332)
at com.facebook.buck.cli.TestCommand.runWithoutHelp(TestCommand.java:548)
at com.facebook.buck.cli.AbstractCommand.run(AbstractCommand.java:227)
at com.facebook.buck.cli.AbstractContainerCommand.run(AbstractContainerCommand.java:67)
at com.facebook.buck.cli.BuckCommand.run(BuckCommand.java:81)
at com.facebook.buck.cli.Main.runMainWithExitCode(Main.java:984)
at com.facebook.buck.cli.Main.runMainThenExit(Main.java:371)
at com.facebook.buck.cli.Main.nailMain(Main.java:1729)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.martiansoftware.nailgun.NGSession.run(NGSession.java:329)
My guess is because there is no java, it is missing the used-classes.json
file. Test targets that contain mixed java + kotlin do not have this issue.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Robolectric cannot download artifacts - all tests fail · Issue #5456
I'm not sure of the root cause, but I'd highly recommend downloading and storing the android-all artifacts locally, and running Robolectric in ...
Read more >Unit Testing with Robolectric | CodePath Android Cliffnotes
Overview to Robolectric. It allows Android applications to be tested on the JVM without an emulator or device. Running Android tests on the...
Read more >Unable to test kotlin interface with Robolectric - Stack Overflow
Currently, I am using a testing framework called ...
Read more >Robolectric tests run in Android Studio 4.1 fail with a bad ASM ...
Issue. When I run Robolectric-based unit tests in the IDE the version of ASM linked in appears to be wrong. I get the...
Read more >On Kotlin: A Unit Test Conversion Guide | by Doug Arcuri
It begins with unit tests. If the information that follows helps just one engineer to better understand usage, it has served its purpose....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m working in this area right now, might as well fix this while I’m at it.
@kageiit I expect so.