Android: Gradle imports failing to resolve - android

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

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

Error:(23, 20) Failed to resolve: com.github.chrisbanes:PhotoView:2.1

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.

Retrofit 2 dependencies issue

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

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