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+Gradle: Unresolved reference: assertThatJson

See original GitHub issue

Hi,

I’m using JsonUnit+AssertJ in a Kotlin+Gradle project and I’m getting this error:

$ ./gradlew test

> Task :compileTestKotlin FAILED
e: /private/tmp/DataClassKonverter/src/test/kotlin/MainKtTest.kt: (4, 40): Unresolved reference: assertThatJson
e: /private/tmp/DataClassKonverter/src/test/kotlin/MainKtTest.kt: (23, 9): Unresolved reference: assertThatJson
e: /private/tmp/DataClassKonverter/src/test/kotlin/MainKtTest.kt: (24, 13): Unresolved reference: isObject
e: /private/tmp/DataClassKonverter/src/test/kotlin/MainKtTest.kt: (25, 13): Unresolved reference: node
e: /private/tmp/DataClassKonverter/src/test/kotlin/MainKtTest.kt: (26, 13): Unresolved reference: node

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileTestKotlin'.
> Compilation error. See log for more details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
1 actionable task: 1 executed

I have this in my dependencies:

implementation("net.javacrumbs.json-unit:json-unit-assertj:2.19.0")

Please also find an example project attached.

Not sure if it’s similar to #293.

EDIT Fixed and re-uploaded example project.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
lukas-krecancommented, Nov 7, 2020

Fixed in 2.21.0

0reactions
lukas-krecancommented, Nov 5, 2020

You, are right, it does not work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unresolved reference kotlintest while using gradle kotlin dsl
I get the following error : Task with name 'test' not found in project ':app'. My settings.gradle.kts : include(" ...
Read more >
"Unresolved reference: Kotlin" when compiling proto #536
Hey, there have been a few issues regarding this topic (example), however the solutions haven't worked for me. I have a foo proto...
Read more >
2020.3+: Unresolved reference to Kotlin stdlib function
I encountered the unresolved functions part (println, readText) loading an older project using Kotlin 1.3. x (Gradle) in IDEA with plugin from 1.4...
Read more >
Unresolved Reference - Unable to unit test the gradle plugin
Hi folks! So I'm working on a few of the gradle plugin bugs and unfortunately I've noticed that the build does not allow...
Read more >
Unresolved reference: enableAssertions - SQA Stack Exchange
But how would I enable the flag through kotlin gradle DSL? Java SE assertions: docs.oracle.com/javase/7/docs/technotes/guides/language/… – ...
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