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
CodePudding user response:
Until you find a valid replacement you can turn on Gradle Offline sync. Go to Gradle -> Toggle Offline Mode
CodePudding user response:
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"

