Home > Blockchain >  Can't add dependency from library with suffix HEAD-SNAPSHOT
Can't add dependency from library with suffix HEAD-SNAPSHOT

Time:09-30

I'm following a github project example where the user adds a library depency in the build.gradle file. They have the dependencies

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation 'androidx.core:core-ktx:1.1.0'
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3''

    implementation 'org.xrpl:xrpl4j-client:HEAD-SNAPSHOT'
    implementation 'org.xrpl:xrpl4j-keypairs:HEAD-SNAPSHOT'
}

I've tried adding the same dependencies to my project but the last two dependencies is causing the gradle project to fail syncing.

enter image description here

enter image description here

What exactly am I doing incorrectly when trying to import these two dependencies?

The only difference is that my project is java based and the github example is kotlin based, but that shouldn't make any difference right? Because the library I'm trying to import is for Java.

CodePudding user response:

Yes exactly as i though , if you check here https://github.com/nhartner/xrpl4j-android-demo/blob/main/app/build.gradle#L34

He is using mavenlocal() , So by replacing them into

implementation 'org.xrpl:xrpl4j-client:2.1.0'
implementation 'org.xrpl:xrpl4j-keypairs:2.1.0'

and removing mavenlocal() from repositories , might fix the problem . unless he did any kind of modification to his local version .

for more reading about maven local https://docs.gradle.org/current/userguide/declaring_repositories.html#sec:case-for-maven-local

  • Related