diff --git a/app.config.js b/app.config.js index 630ea5ad8c..1461b7b885 100644 --- a/app.config.js +++ b/app.config.js @@ -232,6 +232,7 @@ module.exports = function (config) { './plugins/withAndroidManifestFCMIconPlugin.js', './plugins/withAndroidStylesAccentColorPlugin.js', './plugins/withAndroidSplashScreenStatusBarTranslucentPlugin.js', + './plugins/withAndroidNoJitpackPlugin.js', './plugins/shareExtension/withShareExtensions.js', './plugins/notificationsExtension/withNotificationsExtension.js', './plugins/withAppDelegateReferrer.js', diff --git a/plugins/withAndroidNoJitpackPlugin.js b/plugins/withAndroidNoJitpackPlugin.js new file mode 100644 index 0000000000..959eb10282 --- /dev/null +++ b/plugins/withAndroidNoJitpackPlugin.js @@ -0,0 +1,20 @@ +const {withProjectBuildGradle} = require('@expo/config-plugins') + +const jitpackRepository = "maven { url 'https://www.jitpack.io' }" + +module.exports = function withAndroidNoJitpackPlugin(config) { + return withProjectBuildGradle(config, config => { + if (!config.modResults.contents.includes(jitpackRepository)) { + throw Error( + 'Expected to find the jitpack string in the config. ' + + 'You MUST verify whether it was actually removed upstream, ' + + 'or if the format has changed and this plugin no longer recognizes it.', + ) + } + config.modResults.contents = config.modResults.contents.replaceAll( + jitpackRepository, + '', + ) + return config + }) +}