502 google.bintray.com Bad Gateway - android

I have started to build Gradle in my android project but I had the following problem, does anyone know what happens?
I'm trying to get the Tflite dependency from Maven, never had a problem until today.
Could not determine the dependencies of task ':app:processDebugResources'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
> Could not resolve org.tensorflow:tensorflow-lite:+.
Required by:
project :app > project :tflite
> Failed to list versions for org.tensorflow:tensorflow-lite.
> Unable to load Maven meta-data from https://google.bintray.com/exoplayer/org/tensorflow/tensorflow-lite/maven-metadata.xml.
> Could not get resource 'https://google.bintray.com/exoplayer/org/tensorflow/tensorflow-lite/maven-metadata.xml'.
> Could not GET 'https://google.bintray.com/exoplayer/org/tensorflow/tensorflow-lite/maven-metadata.xml'. Received status code 502 from server: Bad Gateway

We experienced the same the last two days. It looks like it is working again.

after 3 days working on a such problem
I solved it by editing the project buildgradle
[appname]/build.gradle
as below
repositories {
google()
//commit this: maven
//maven()
// add this
mavenCentral()
}
allprojects {
repositories {
google()
//commit this: maven
//maven()
// add this
mavenCentral()
}
}
Bonus:
i had the same problem with the same library so maybe you need this setting on the same build.gradle file
Kotlin version:
ext.kotlin_version = '1.5.0'
dependencies:
classpath 'com.android.tools.build:gradle:4.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

For those who still have issues with JCenter / Bintray, you can switch to JitPack.
All you need to do is to search the GitHub project of your choice in https://jitpack.io then copy-paste the provided code in your build.gradle file.

Comment jcenter() and add mavenCentral()
repositories {
jcenter()
mavenCentral()
google()
}

Related

Import RealmRecyclerViewAdapter throught mavenCentral() instead of jcenter()

This is a pretty straightforward question I would like to use the RealmRecyclerViewAdapter library on my project, but when I try to import it using mavenCentral() on my dependencies I got this error:
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find io.realm:android-adapters:3.1.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/io/realm/android-adapters/3.1.0/android-adapters-3.1.0.pom
- https://repo.maven.apache.org/maven2/io/realm/android-adapters/3.1.0/android-adapters-3.1.0.pom
Required by:
project :app
However if I just use jcenter() it works fine.
I'm changing it here at my module gradle file:
repositories{
jcenter()
//mavenCentral()
}
Is there any way to import this using mavenCentral() ?
I have a method which can help you get this library through jitpack.io repository.
First, add the repository in the repositories {} block like this:
repositories {
...
maven { url 'https://jitpack.io' }
}
Then add the dependency like this:
dependencies {
implementation 'com.github.realm:realm-android-adapters:v3.1.0'
}
No there is no way , Because its not even available on mavenCentral() .
As you can see here in the Note section
Note: this artifact is located at Realm repository (https://dl.bintray.com/realm/maven/)
So what you need to do is the following
maven {
url "https://dl.bintray.com/realm/maven/"
}
This way it should be accessable with no need to jcenter()

Android Studio Gradle: Please remove usages of `jcenter()` Maven repository from your build scripts / JCenter is at end of life

In Android Studio 4.2 there is a warning:
buildscript {
ext.kotlin_version = '1.5.0'
repositories {
google()
//jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
//jcenter()
mavenCentral()
}
}
If I remove jcenter() then it can't find some dependencies of my app project:
> Could not find org.koin:koin-core:2.0.1.
Required by:
project :app
> Could not find org.koin:koin-androidx-scope:2.0.1.
Required by:
project :app
> Could not find org.koin:koin-androidx-viewmodel:2.0.1.
Required by:
project :app
> Could not find com.google.ads.mediation:chartboost:8.1.0.0.
Required by:
project :app
In replace of jcenter() I added mavenCentral()
Move mavenCentral() above jcenter().
do a clean/build on your project.
comment out jcenter()
By moving mavenCentral() above jcenter(), mavenCentral() now becomes the primary repository for all non Google artifacts. By doing a clean and build, all artifacts are now moved to mavenCentral().
I had to look this up and tried it. I went from all heck breaking loose after I removed jcenter() to being able to build my final project for school again.
For koin, change the group id from org.koin to io.insert-koin - the latter is published on maven central.
For chartboost, you can use the following repo:
maven {
url "https://dl.bintray.com/google/mobile-ads-adapters-android/"
}
Also note that there are newer versions such as koin 2.2.2 / 3.0.1 and chartboost 8.2.0.0. Older versions are likely not republished in non-jcenter repos.
mvnrepository is a good service for locating packages.
just commenting out jcenter() will help,
mavencentral() is already above jcenter.
Locate all build.gradle files in your project folder tree, open them and replace jcenter() by mavenCentral(). It works for me most of the time.
It is interesting that the AndroidStudio project template still adds the ref to jcenter() to gradle, but then as soon as the project attempts to build it requests that you remove it.
I just delete it from the gradle file and then it works.
So there are two issues here.
First, we need to move MavenCentral above jCenter in all projects
Second, Android build tools version need to upgraded to 4.2.0 and above. As Android internal build tool dependencies are going to jCenter
dependencies {
classpath("com.android.tools.build:gradle:4.2.0")
}
It should work
Hope this will help
Go to App/Gradle Scripts/build.gradle (Project:---)
Change the jcenter() on build script{} and in all project repositories.
and Sync now.
This is how it looklike before.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and after.
buildscript {
repositories {
google()
mavencentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
}
}
allprojects {
repositories {
google()
mavencentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
This might help someone.
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
...
}
}
I used this to resolve:
> Could not find com.github.parse-community.Parse-SDK-Android:parse:1.26.0.
Required by:
project :app
I got the same error, while i was using the Android Studio Artic Fox Beta - 3 but after change Android Studio as Canary Build the error gone
The solution I did was to change build:gradle version:
dependencies {
classpath("com.android.tools.build:gradle:4.2.2")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
The solution is simpe
just Locate build.gradle and replace jcenter() by mavenCentral().
good luck

Trove4j library cannot be resolved

I'm getting the following error when trying to compile my app:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':myProject'.
> Could not resolve all files for configuration ':myProject:classpath'.
> Could not find org.jetbrains.trove4j:trove4j:20160824.
Searched in the following locations:
https://repo1.maven.org/maven2/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.pom
https://repo1.maven.org/maven2/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.jar
https://maven.fabric.io/public/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.pom
https://maven.fabric.io/public/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.jar
https://maven.google.com/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.pom
https://maven.google.com/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.jar
Required by:
project :metam > com.android.tools.build:gradle:3.0.0-beta2 > com.android.tools.build:gradle-core:3.0.0-beta2 >
com.android.tools.lint:lint:26.0.0-beta2 > com.android.tools.lint:lint-checks:26.0.0-beta2 > com.android.tools.lint:lint-
api:26.0.0-beta2 > com.android.tools.external.com-intellij:intellij-core:26.0.0-beta2
It appears a library the IDE needs is missing?
this issue can be resolved by adding jcenter() as a repository in the buildscript section.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-beta2'
}
}
Additional to Snicolas' answer:
If you have something like:
allprojects {
repositories {
mavenCentral()
google()
jcenter() //also add it here!!!
}
}
In your build.gradle file; also add it there.
Since jCenter will close in May, you should change root/build.gradle so:
buildscript {
repositories {
google()
gradlePluginPortal()
}
}
allprojects {
repositories {
google()
mavenCentral()
// org.jetbrains.trove4j:trove4j:20160824.
gradlePluginPortal()
}
}
See also https://stackoverflow.com/a/66168563/2914140 to add libraries not included in Maven.
Now we can build apk without errors.
If you're seeing this error after May 1st 2021, it's probably because jcenter is shut down. It's needed by the Android Gradle Plugin (AGP). Google devs have said they're using a newer version of the library that can be got from mavenCentral() as of AGP 7 and hoping to backport that into AGP 4.2 and 4.1. So first of all, try and upgrade to AGP 7. And if I haven't edited this post with updates, check to see is it in any lower AGP versions.
But if you can't upgrade AGP, as of initial time of posting (February 2021), the only repo I could find with the trove package is on pentaho, which seems to be owned by Hitachi so I presume it's safe.
buildscript {
repositories {
maven { url "https://nexus.pentaho.org/content/groups/omni" }
}
dependencies {
classpath 'org.jetbrains.trove4j:trove4j:20160824'
}
}
This is NOT an ideal solution. This repo could be intended to be private for all I know. Look for a better answer that might be posted after me.
I solved this problem
deleting in build.gradlew
repositories {
jcenter()
}
And change the mavenCentral() to jcenter() and deleting google()
Migrating away from jcenter? jcenter will sunset on the 1st of May
You may face this issue if you are migrating away from jcenter. The issue happens because Trove4j library was being fetched from jcenter and you removed jcenter repository while migrating away from jcenter.
Solution:
Add the following to the project build.gradle:
maven { url 'https://plugins.gradle.org/m2/' }
It should be added to:
build.gradle(peoject) -> buildscript -> repositories
build.gradle(peoject) -> allprojects -> repositories
buildscript {
repositories {
google()
mavenCentral()
// ** Add this line **
maven { url 'https://plugins.gradle.org/m2/' }
}
}
allprojects {
repositories {
google()
mavenCentral()
// ** Add this line **
maven { url 'https://plugins.gradle.org/m2/' }
}
}
Since jcenter will sunset on 1st of May, 2021. jcenter repository should be removed from the project. This means that all occurrences to "jcenter()" should be removed. This can lead to an issues with the libraries hosted by jcenter. You should provide another repository that host the library such as maven. Some unmaintained libraries maybe are not moved to any other repository. In this case, you might need to consider opening an issue for the library or not using it. You will face all these issues on the 1st of May and you may be unable to build your app if you are not doing the migration now.
Just delete .idea,.gradle and gradle folder and restart your application.
Try to replace mavenCentral() with jcenter() in your build.gradle file
allprojects {
repositories {
jcenter()
//.......
}
}
Go to Help->About in Android Studio and check your version. Enter that vesion in build.gradle App Mudule & same for project build.gradle as done in the
classpath line here:
buildscript {
...
repositories {
...
}
dependencies {
...
classpath "com.android.tools.build:gradle:{THREE.DIGIT.VERSION}"
}
}
This was happening to me every time I upgraded the Gradle Plugin, so what I did and worked:
Delete your package-lock.json or yarn.lock
Run npm i or yarn to update all node modules in your project
Rename your ios project to ios_ for example
Run react-native link to link all dependencies again to your android project
Rename back ios_ to ios
Check the file (project/build.gradle) what Gradle Plugin version you're using. The version 3.4.1 worked for me.
Check your Gradle version (gradle/wrapper/gradle-wrapper.properties), the version 5.4.1 worked here.
Open your Android project using Android Studio, navigate to Build > "Rebuild project"
And finally, try sync/build again.
Hope it can help someone.

Gradle error : Could not find com.android.tools.build:gradle:2.2.3

I'm trying to build my android project using gradle and circleCI, but I've got this error :
* What went wrong:
A problem occurred configuring root project '<myproject>'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:2.2.3.
Searched in the following locations:
file:/home/ubuntu/.m2/repository/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom
file:/home/ubuntu/.m2/repository/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.jar
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.jar
https://oss.sonatype.org/content/repositories/snapshots/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom
https://oss.sonatype.org/content/repositories/snapshots/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.jar
Required by:
:<myproject>:unspecified
Can someone explain me why I've got this problem please?
It seems the current versions of the Android Gradle plugin are not added to Maven Central, but they are present on jcenter. Add jcenter() to your list of repositories and Gradle should find version 2.2.3. On Maven Central the newest available version is 2.1.3: http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.android.tools.build%22%20AND%20a%3A%22gradle%22. You can also complain to the authors that the current versions are missing on Maven Central.
Reading sembozdemir answer in this post I have resolved a similar problem adding jcenter() in build.gradle (module: cordovaLib)
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
}
}
After the recent update to Android Studio 3.0 Canary 1, I got the following error:
> Could not resolve all dependencies for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:3.0.0-alpha1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-alpha1/gradle-3.0.0-alpha1.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-alpha1/gradle-3.0.0-alpha1.jar
Required by:
project :
Here is what I had to add (to the project-level build.gradle):
buildscript {
repositories {
maven {
url 'https://maven.google.com'
}
....
}
Found here: https://developer.android.com/studio/preview/features/new-android-plugin-migration.html
i had the same issue when i update my android studio to 3.0 then its solved by adding
buildscript {
repositories {
...
// You need to add the following repository to download the
// new plugin.
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
}
}
from https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html#update_gradle
On my side I got the same issue because I used the wrong order of repositories.
google() should be added before jcenter()
buildscript {
repositories {
google()
jcenter()
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
}
}
Just change the mavenCentral() to jcenter()
Do you try it
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
// NOTE: Do not place your application dependencies here; they belong
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
flatDir {
dirs 'libs'
}
}
}
and
Build->Clear Project
Try this:
allprojects {
buildscript {
repositories {
maven {
url "https://dl.bintray.com/android/android-tools"
}
}
}
...
}
Updating CordovaLib -> build.gradle also worked for me, as above. I was looking at the root build.gradle initially which was correct and already included jcenter().
Only go to the following path and delete the caches folder completely then rebuild the project:
C:\Users\[Your User Name]\.gradle
Change the gradle version as same to android version like Right know we are using 2.3.2 of gradle
Add jcenter in your project gradle file and sync
The issue is caused by your type of internet connection which prevents or blocks Android Studio from downloading required files from jcenter, this should happen automatically when you build your solution. The solution to your problem is to connect to internet using your personal internet connection such as ADSL Router, rebuild the project and the download of necessary files will happen automatically.

Android Test Module (Gradle Plugin 1.3): dependencies from non-default maven repositories

I'm trying out APK Tests in Modules and went through the whole setup process. It seams that Gradle has problem finding dependencies of an app module if they are fetched from repositories other then jCenter.
One of the dependencies is MPAndroidChart located using jitpack:
repositories {
maven { url "https://jitpack.io" }
}
But plugin: 'com.android.test' seems to ignore this clause: it's not propagated from app module.
Reported error:
Error:A problem occurred configuring project ':test'.
> Could not resolve all dependencies for configuration ':test:_debugCompile'.
> Could not find com.github.PhilJay:MPAndroidChart:v2.0.9.
Searched in the following locations:
https://jcenter.bintray.com/com/github/PhilJay/MPAndroidChart/v2.0.9/MPAndroidChart-v2.0.9.pom
https://jcenter.bintray.com/com/github/PhilJay/MPAndroidChart/v2.0.9/MPAndroidChart-v2.0.9.jar
file:/Users/me/Library/Android/sdk/extras/android/m2repository/com/github/PhilJay/MPAndroidChart/v2.0.9/MPAndroidChart-v2.0.9.pom
file:/Users/me/Library/Android/sdk/extras/android/m2repository/com/github/PhilJay/MPAndroidChart/v2.0.9/MPAndroidChart-v2.0.9.jar
file:/Users/me/Library/Android/sdk/extras/google/m2repository/com/github/PhilJay/MPAndroidChart/v2.0.9/MPAndroidChart-v2.0.9.pom
file:/Users/me/Library/Android/sdk/extras/google/m2repository/com/github/PhilJay/MPAndroidChart/v2.0.9/MPAndroidChart-v2.0.9.jar
Required by:
company-android-app:test:unspecified > company-android-app:app:unspecified
Looks like the problem can be omitted by explicitly adding the repository to the test module:
repositories {
maven { url "https://jitpack.io" }
mavenCentral()
}
Tested with buildToolsVersion '23.0.0rc3' and classpath 'com.android.tools.build:gradle:1.3.0'

Categories

Resources