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

TylerH
  • 20,799
  • 66
  • 75
  • 101
Shweta
  • 79
  • 1
  • 5
  • share room gradle dependencies – Muhammad Asad Jan 12 '22 at 06:21
  • this is expected behavior due to Bintray sunset. Please read this article https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/ – Lakshmi Prasad Jan 12 '22 at 06:50
  • @MuhammadAsad implementation 'androidx.room:room-runtime:2.2.4' annotationProcessor 'androidx.room:room-compiler:2.2.4' – Shweta Jan 12 '22 at 06:53
  • Also if I move my google() jcenter() dependencies above http://dl.bintray.com/populov/maven repo in gradle file then I get other bintray errors like.... > Could not GET 'http://dl.bintray.com/populov/maven/com/theartofdev/edmodo/android-image-cropper/maven-metadata.xml'. Received status code 502 from server: Bad Gateway – Shweta Jan 12 '22 at 07:18
  • 1
    try using mavenCentral() instead of jcenter() – Ajay K S Jan 12 '22 at 07:20
  • use this version room_version = "2.4.0" – Muhammad Asad Jan 12 '22 at 07:26
  • repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { google() mavenCentral() jcenter() maven { url 'https://jitpack.io' } } add this in your setting.gradle – Muhammad Asad Jan 12 '22 at 07:26
  • JCenter is down and it broke gradle: https://status.gradle.com/incidents/nv93msj8q658 – Konstantin Tarashchanskiy Jan 12 '22 at 18:49

4 Answers4

1

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

enter image description here

Amit Kundu
  • 119
  • 5
  • 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. – Shweta Jan 12 '22 at 06:32
  • Hey did you find a solution? After researching a lot it seems that status.bintray.com is down and build isn't happening... – Abhi Burk Jan 12 '22 at 17:55
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"
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.

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.