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.
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/
Related
I am having a 502 Gateway error when gradle try to fetch artifacts from 'https://jcenter.bintray.com/. I have tried to remove the jcenter repository from my platforms/android/build.gradle file but nothing change. I also changed the configuration of my repositories but during the compilation still calling the jcenter.bintray.com that seems to be down.
buildscript {
repositories {
google()
maven { url "https://jcenter.bintray.com" }
maven { url "https://dl.bintray.com" }
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://jitpack.io' }
mavenCentral()
maven { url "https://maven.google.com" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
}
}
// Allow plugins to declare Maven dependencies via build-extras.gradle.
allprojects {
repositories {
google()
mavenCentral()
maven { url "https://jcenter.bintray.com" }
maven { url "https://dl.bintray.com" }
maven { url 'https://jitpack.io' }
maven { url "https://maven.google.com" }
maven { url 'https://maven.fabric.io/public' }
}
}
Trying the gradle-lint-plugin I get no console output even do the project is large. I think I missed something in the configuration and asking here for help to find that.
Reading the wiki Using-Lint there´s nothing mentioned if the lintGradle task dosen´t find anything to warn about, maybe that´s what happening in my case.
Here´s the build.grade.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'https://jitpack.io' }
maven { url "https://jcenter.bintray.com" }
maven { url 'https://maven.fabric.io/public' }
google()
}
dependencies {
classpath 'com.netflix.nebula:gradle-lint-plugin:9.0.0'
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.2.0'
classpath ('com.google.firebase:firebase-plugins:1.0.5') {
// Note https://issuetracker.google.com/issues/38419426#comment8
exclude group: 'com.google.guava', module: 'guava-jdk5'
}
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
plugins {
id 'nebula.lint' version '9.0.0'
}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
maven { url "https://jitpack.io" }
maven { url "https://maven.google.com" }
google()
}
}
apply plugin: 'nebula.lint'
gradleLint.rules = ['dependency-parentheses']
gradleLint.criticalRules = ['unused-dependency'] // <-- this will fail the build in the event of a violation
// gradleLint.alwaysRun = false
task clean(type: Delete) {
delete rootProject.buildDir
}
I am trying to install with gradle this library:
https://android-arsenal.com/details/1/6652
It NEEDS jitpack in the gradle:
allprojects {
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
}
}
All fixes I have found result in me having to replace the above with maven.google.
I need to use jitpack.
The errors i get:
Failed to resolve com.android.support.appcompat.
Add https://maven.google.com or google() to your repositories block.
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
maven {
url "https://jitpack.io"
}
}
}
OR
allprojects {
repositories {
jcenter()
google()
maven {
url "https://jitpack.io"
}
}
}
Add AppCompact lib as below:
In the app.gradle, add appCompact lib:
implementation "com.android.support:appcompat-v7:27.0.0"
Add google() as below:
allprojects {
repositories {
jcenter()
google()
maven {
url "https://jitpack.io"
}
}
}
I want to use PhotoView for zooming in android
https://github.com/chrisbanes/PhotoView
but I'm getting the following error
dependencies {
implementation 'com.github.chrisbanes:PhotoView:2.1.3 '//zoom
implementation 'com.android.support:support-v4:26.0.2 '
}
root level build.gradle
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
Make sure, You added this in your root level build.gradle section.
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
After that, Clean-Rebuild-Run.
Demo
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
try to compile with previous dependency version like
implementation 'com.github.chrisbanes:PhotoView:2.0.0'
clean project and rebuild.
I have the following build.gradle file:
buildscript {
repositories {
jcenter()
maven {
url "https://another.url/repo"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
}
}
allprojects {
repositories {
jcenter()
}
}
How can i add a second maven url like this one: "${System.env.HOME}/.m2/repository"? i have to keep the another url repository.