0

I was implementing the cuberto liquid swipe animation in my app and after adding the github.properties and the dependencies as I added the code to build.gradle inside the app module that will be using the library. Then compile and run the app, it was giving an error - Could not GET 'https://maven.pkg.github.com/Cuberto/liquid-swipe-android/com/cuberto/liquid-swipe/1.0.0/liquid-swipe-1.0.0.aar'. Received status code 400 from server: Bad Request Disable Gradle 'offline mode' and sync project ..

here is my build.gradel code -

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.2.1"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()

        def githubProperties = new Properties()
        githubProperties.load(new FileInputStream(rootProject.file("github.properties")))
        repositories {
            maven {
                name = "GitHubPackages"

                url = uri("https://maven.pkg.github.com/Cuberto/liquid-swipe-android")
                credentials {
                    /** Create github.properties in root project folder file with
                     ** gpr.usr=GITHUB_USER_ID & gpr.key=PERSONAL_ACCESS_TOKEN
                     ** Or set env variable GPR_USER & GPR_API_KEY if not adding a properties file**/
                    username = githubProperties['gpr.usr'] ?: System.getenv("GPR_USER")
                    password = githubProperties['gpr.key'] ?: System.getenv("GPR_API_KEY")
                }
            }
        }
    }
}

 task clean(type: Delete) {
    delete rootProject.buildDir
}

here is the ss of the actual code given in the github.

enter image description here

and this the link to the github page of cuberto - https://github.com/Cuberto/liquid-swipe-android

Please help me I am unable to solve this past 3 days

Mimu Saha Tishan
  • 2,402
  • 1
  • 21
  • 40
Rajveer Jhalani
  • 49
  • 1
  • 2
  • 3

1 Answers1

0

Okay, thanks for waiting. I have modified some Gradle files for easy importing in which you no need to generate tokens etc. Here is my forked and modified library. Any clarification feel free to comment and contact me.

Update based on your comment,

Step 1:

Make sure you have removed following code from root build.gradle,

def githubProperties = new Properties()
githubProperties.load(new FileInputStream(rootProject.file("github.properties")))
repositories {
    maven {
        name = "GitHubPackages"

        url = uri("https://maven.pkg.github.com/Cuberto/liquid-swipe-android")
        credentials {
            /** Create github.properties in root project folder file with
             ** gpr.usr=GITHUB_USER_ID & gpr.key=PERSONAL_ACCESS_TOKEN
             ** Or set env variable GPR_USER & GPR_API_KEY if not adding a properties file**/
            username = githubProperties['gpr.usr'] ?: System.getenv("GPR_USER")
            password = githubProperties['gpr.key'] ?: System.getenv("GPR_API_KEY")
        }
    }
}

Step 2:

In Android Studio->File->Invalidate Caches/Restart...->Invalidate and Restart(From popup dialouge)

Udhaya
  • 335
  • 3
  • 12
  • thanks but it says dublicate dependencies of yours and the cuberto dependence but i dont have any dublicate dependency here is my build.gradel file - implementation 'com.google.android.material:material:1.3.0' implementation "androidx.core:core:1.5.0" implementation 'com.github.Udhayarajan:liquid-swipe-android:1.0.1' implementation 'com.google.android.material:material:1.3.0' implementation "androidx.core:core:1.5.0" implementation "androidx.core:core-ktx:1.5.0" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" } – Rajveer Jhalani Jun 04 '21 at 03:10
  • @RajveerJhalani kindly check my updated answer – Udhaya Jun 04 '21 at 04:31
  • HEY ..i tried this but still need some help ..i am devoloping my app in java so i should still add the these depencies - implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.6.0-RC2' implementation'androidx.core:core:1.3.1' implementation 'androidx.core:core-ktx:1.3.1' ??? – Rajveer Jhalani Nov 14 '21 at 09:46