Bintray 502 bad gateway in android Studio
Asked Answered
M

4

7

I'm using maven { url "http://dl.bintray.com/populov/maven" } in my project-level build.gradle file. Since bintray is shutdown, what can be the replacement of this repo?

Could not resolve androidx.room:room-compiler:2.2.4. > Could not get resource 'http://dl.bintray.com/populov/maven/androidx/room/room-compiler/2.2.4/room-compiler-2.2.4.pom'. > Could not HEAD 'http://dl.bintray.com/populov/maven/androidx/room/room-compiler/2.2.4/room-compiler-2.2.4.pom'. Received status code 502 from server: Bad Gateway

Meal answered 12/1, 2022 at 6:18 Comment(8)
share room gradle dependenciesScientism
this is expected behavior due to Bintray sunset. Please read this article jfrog.com/blog/…Glair
@MuhammadAsad implementation 'androidx.room:room-runtime:2.2.4' annotationProcessor 'androidx.room:room-compiler:2.2.4'Meal
Also if I move my google() jcenter() dependencies above dl.bintray.com/populov/maven repo in gradle file then I get other bintray errors like.... > Could not GET 'dl.bintray.com/populov/maven/com/theartofdev/edmodo/…'. Received status code 502 from server: Bad GatewayMeal
try using mavenCentral() instead of jcenter()Radioactivate
use this version room_version = "2.4.0"Scientism
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { google() mavenCentral() jcenter() maven { url 'jitpack.io' } } add this in your setting.gradleScientism
JCenter is down and it broke gradle: status.gradle.com/incidents/nv93msj8q658Aphrodisia
A
1

Until you find a valid replacement you can turn on Gradle Offline sync. Go to Gradle -> Toggle Offline Mode

enter image description here

Araiza answered 12/1, 2022 at 6:26 Comment(2)
Thanks for the answer. But enabling gradle offline is a temporary solution. If you find any repo, do share me. Thanks in advance @Amit Kundu.Meal
Hey did you find a solution? After researching a lot it seems that status.bintray.com is down and build isn't happening...Phrase
J
0

if you have a lot of node module which needed to be updated you can do this solution

yarn add -D replace-in-file

const replaceInFiles = require('replace-in-file');
const options = {
  // See more: https://www.npmjs.com/package/globby
  // Single file or glob
  //   node_modules/react-native-pdf/android/build.gradle
  files: './node_modules/**/android/build.gradle',
  // See more: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace
  // Replacement
  from: /jcenter\(\)/g, // string or regex
  to: 'mavenCentral()', // string or fn  (fn: carrying last argument - path to replaced file)

  // See more: https://www.npmjs.com/package/glob
  optionsForFiles: {
    // default
    ignore: [],
  },
  saveOldFile: false,
  encoding: 'utf8',

  shouldSkipBinaryFiles: true, // default
  onlyFindPathsWithoutReplace: false,
  returnPaths: true,
  returnCountOfMatchesByPaths: true,
};
replaceInFiles(options)
  .then(({ changedFiles, countOfMatchesByPaths }) => {
    console.log('Modified files:', changedFiles);
    console.log('Count of matches by paths:', countOfMatchesByPaths);
    console.log('was called with:', options);
  })
  .catch((error) => {
    console.error('Error occurred:', error);
  });
and add this line into package.json scripts
    "postinstall": "node fix-jcenter.js"
Johnathon answered 12/1, 2022 at 23:42 Comment(0)
B
0

it's a global outage in JCenter. You can monitor status here https://status.gradle.com it replaces bintray status page which seems is now fully sunset and returns 502 error.

JCenter is now back online, systems are fully operational.

Biddable answered 13/1, 2022 at 8:21 Comment(0)
L
0

It worked like this here:

Update your android/build.gradle file and change where you have jcenter() to mavenCentral().

In my case I had to update the flipper version in android/gradle.properties FLIPPER_VERSION=0.54.0 to FLIPPER_VERSION=0.93.0.

Now it's back to building for android.

Longitudinal answered 13/1, 2022 at 13:47 Comment(1)
Are you saying that I replace jcenter() to mavenCentral()?Meal

© 2022 - 2024 — McMap. All rights reserved.