4

My build setting is like below. And I get Received status code 521 from server when I build.

buildscript {
    // ...

    repositories {
        google()
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.2.2'
        // ...
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()
        maven { url "https://jitpack.io" }
        maven { url 'https://maven.microblink.com' }
    }
}

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

ext{
    // ...
}
dependencies {
    // ...

    implementation('com.microblink:blinkinput:4.3.0@aar') {
        transitive = true
    }
}

What's wrong with it?

EDIT:

I am using private repository. So, I set

in gradle.properties. (the key is just an example)

authToken=jp_sldjflkjlzjcxlka1223

And in build.gradle.

...
allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()
        maven { url "https://jitpack.io" }
        maven {
            url "https://jitpack.io"
            credentials { username authToken }
        }
    }
}

This gives me Unauthorized(401) error. So, I tried with this too but it gives Forbidden(403).

...
allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()
        maven {
            url "https://jitpack.io"
            credentials { username authToken }
        }
    }
}

The key is correct. And the project built well. It just didn't build well from yesterday.

c-an
  • 3,543
  • 5
  • 35
  • 82
  • You are all set jitpack had an issue in last hour it is all ok now – Mkhakpaki Sep 15 '21 at 10:12
  • @Mkhakpaki Okay, now I have 401(Unauthorized), 403(Forbidden) error for private repository. I set all correctly but it doesn't run correctly. Why is that? – c-an Sep 15 '21 at 13:00
  • I am having the same problem since this morning but with jCenter dependencies, some of them are returning 502/403, although they are all public, I copied their URL to test them in the browser, it returns the same error code but sometimes it works and starts downloading. – Houssem Nasri Sep 16 '21 at 10:03
  • https://status.gradle.com/incidents/ndfqcnmqc8n7 – Houssem Nasri Sep 16 '21 at 10:12
  • @HoussemNasri does `jitpick` uses `jcenter `? – c-an Sep 18 '21 at 08:59
  • as far as I know, they are completely different, the issue with jCenter is resolved so if you still get an error it's probably something else – Houssem Nasri Sep 18 '21 at 14:14
  • I removed jcenter and replaced all to somethimg else like maven and I still get the same error. – c-an Sep 19 '21 at 02:46

1 Answers1

0

When you are adding maven jitpack to your project level gradle file you should add your jitpack token too

allprojects {
repositories {
    google()
    jcenter()
    mavenCentral()
    maven { 
      url "https://jitpack.io" 
        credentials { username = project.properties['jitpackToken'] }
    }
    maven { url 'https://maven.microblink.com' }
 }
}

You can find more info here https://jitpack.io/docs/PRIVATE/

Mkhakpaki
  • 120
  • 2
  • 12
  • I updated my question. I already set it correctly and it just started giving error from yesterday. @Mkhakpaki. – c-an Sep 16 '21 at 01:47
  • If the code you pasted is your real code then it is normal to have an error because you are defining your jitpack token in your gradle.properties but you dont point it there, just copy and paste my code about using jitpack token in gradle properties and it should work – Mkhakpaki Sep 16 '21 at 07:29