question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Kotlin only robolectric_test targets fail to compile

See original GitHub issue

The 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:closed
  • Created 6 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
jkeljocommented, Sep 15, 2017

I’m working in this area right now, might as well fix this while I’m at it.

0reactions
jkeljocommented, Sep 15, 2017

@kageiit I expect so.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found