Retrofit 2 dependencies issue - android

I am using retrofit 2 library for network calls.Project is not builing up even after adding dependencies. I have attached the screenshot.

In your Fame-Circle's project level build.gradle file (The recently added screenshot),
add:
maven { url 'https://maven.google.com' }
which should now look like:
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
}
}

Try to add below line inside your Frame-Circle main gradle file
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
maven { url "https://maven.google.com" }
}
}

Related

jitpack - Received status code 521/401/403 from server

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/

502 Gate way gradle error: Could not GET 'https://jcenter.bintray.com/ when build .apk

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' }
}
}

Android: Gradle imports failing to resolve

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"
}
}
}

Android Studio 3.0 Canary 1 - Unable to connect to maven.google.com

I follow Migrate to the New Plugin doc,add google maven "https://maven.google.com"
buildscript {
repositories {
mavenCentral()
jcenter()
// jcenter {
// url "http://jcenter.bintray.com/"
// }
//这里是 LeanCloud 的包仓库
maven {
url "http://mvn.leancloud.cn/nexus/content/repositories/releases"
}
//MPAndroidChart仓库
maven { url "https://jitpack.io" }
//google
maven {
url 'https://maven.google.com'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha1'
classpath group: 'org.tmatesoft.svnkit', name: 'svnkit', version: '1.8.11'
classpath 'com.jakewharton:butterknife-gradle-plugin:7.0.1'
// https://mvnrepository.com/artifact/com.jakewharton/butterknife
// classpath group: 'com.jakewharton', name: 'butterknife', version: '7.0.1'
}
}
to gradle script.
After that,when i build project,got this error:
Error:No route to host
I use VPN and connect to google.com fine.
How can i fix this problem
You should delete the Google maven repo from your app/gradle and instead put it your project base gradle file :
buildscript {
repositories {
mavenCentral()
jcenter()
maven { url 'https://maven.google.com' }
}
...

Adding a Maven url in Android Studio Gradle

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.

Categories

Resources