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.

I am really confused, which dependency should be used?

See original GitHub issue

https://github.com/kotlinx/ast#using-with-gradle tells me

            dependencies {
                // please look at https://jitpack.io/#drieks/antlr-kotlin to find the latest version
                api("com.github.kotlinx.ast:grammar-kotlin-parser-antlr-kotlin:0123456789")

or

// please look at https://jitpack.io/#drieks/antlr-kotlin to find the latest version
implementation("com.github.kotlinx.ast:grammar-kotlin-parser-antlr-kotlin:0123456789")

https://jitpack.io/#drieks/antlr-kotlin tells me to use implementation 'com.github.drieks:antlr-kotlin:Tag'

https://jitpack.io/#drieks/antlr-kotlin/d4384e4d90 tells me to use implementation 'com.github.drieks.antlr-kotlin:antlr-kotlin-gradle-plugin:d4384e4d90'

Neither api("com.github.kotlinx.ast:grammar-kotlin-parser-antlr-kotlin:d4384e4d90") nor drieked version with api("com.github.drieks.ast:grammar-kotlin-parser-antlr-kotlin:d4384e4d90") works

And Android Studio requires me to use implementation("com.github.drieks.antlr-kotlin:antlr-kotlin-gradle-plugin:d4384e4d90") (a bit different syntax)

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
matkonieczcommented, Jul 14, 2022

https://github.com/2bad2furious/kotlinx-ast-demo worked with minor tweaks (making gradlew executable, adding gradle folder)

0reactions
matkonieczcommented, Jul 14, 2022

I tried again ( https://github.com/matkoniecz/astmine ) :


But the readme should contain working examples, there must be a missing change that is required to get it working again.

Note that “Add the dependency to kotlinx.ast into your project:” is confusing for confused people like me. Looking at other code I have not found where exactly this snippet should be added.

If there would be chance for standalone working example - it would be highly appreciated.

Note: that is my first time when I tried making from scratch a gradle-powered project. It is likely that my failure is entirely caused by doing something the wrong way with gradle.

On retrying, if it will happen, I should use Groovy instead of Kotlin. Maybe instructions in repo are actually for Groovy? (though it mentions build.gradle.kts…)


api("com.github.kotlinx.ast:grammar-kotlin-parser-antlr-kotlin:14e92f2fa0") from readme got me

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileKotlin'.
> Error while evaluating property 'filteredArgumentsMap' of task ':app:compileKotlin'
   > Could not resolve all files for configuration ':app:compileClasspath'.
      > Could not find com.github.kotlinx.ast:grammar-kotlin-parser-antlr-kotlin:14e92f2fa0.
        Searched in the following locations:
          - https://repo.maven.apache.org/maven2/com/github/kotlinx/ast/grammar-kotlin-parser-antlr-kotlin/14e92f2fa0/grammar-kotlin-parser-antlr-kotlin-14e92f2fa0.pom
          - https://jitpack.io/com/github/kotlinx/ast/grammar-kotlin-parser-antlr-kotlin/14e92f2fa0/grammar-kotlin-parser-antlr-kotlin-14e92f2fa0.pom
        Required by:
            project :app

https://jitpack.io/#drieks/antlr-kotlin suggested implementation("com.github.drieks:antlr-kotlin:Tag") (I tried with Kotlin-based build script), it resulted in

> Task :app:compileKotlin FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileKotlin'.
> Error while evaluating property 'filteredArgumentsMap' of task ':app:compileKotlin'
   > Could not resolve all files for configuration ':app:compileClasspath'.
      > Could not find com.github.drieks:antlr-kotlin:Tag.
        Searched in the following locations:
          - https://repo.maven.apache.org/maven2/com/github/drieks/antlr-kotlin/Tag/antlr-kotlin-Tag.pom
          - https://jitpack.io/com/github/drieks/antlr-kotlin/Tag/antlr-kotlin-Tag.pom
        Required by:
            project :app
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Prevent Dependency Confusion - ActiveState
Best Practices for Mitigating Dependency Confusion Risks​​ There's no simple answer, but a variety of practices can help: Utilize Scopes/ ...
Read more >
What Did Twilio Do to Solve Dependency Confusion
In this section, we've gathered some answers about how dependency confusion works, how we're defending against it at Twilio, and how you can ......
Read more >
Understanding and Preventing Dependency Confusion Attacks
Dependency confusion is a software supply chain exploit that takes advantage of a quirk in certain package managers to inject unwanted (and ...
Read more >
Dependency Confusion: How I Hacked Into Apple, Microsoft ...
Ever since I started learning how to code, I have been fascinated by the level of trust we put in a simple command...
Read more >
spring boot - Maven - getting different versions when using jar ...
I would say: If something is a library, i.e. is meant to be a dependency, then avoid dependencyManagement. Do the dependencyManagement on the ......
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