JCenter シャットダウン後の Gradle ビルド

重要

Visual Studio App Center は、2025 年 3 月 31 日に廃止される予定です。 完全に廃止されるまで Visual Studio App Center を引き続き使用できますが、移行を検討できる推奨される代替手段がいくつかあります。

詳細については、サポートタイムラインと代替手段に関するページを参照してください。

AppCenter Android ビルドで JCenter リソースと Bintray リソースを使用していて、Gradle タスクエラーでビルドが失敗した場合 (リソース エラーを取得できませんでした)、JCenter Bintray がシャットダウンされているためです。 ビルド ログの次の行は、この問題を示しています。

Resolved com.android.tools.build:gradle:3.5.4 in :classpath 
Resolved com.google.gms:google-services:4.2.0 in :classpath 
Project mobileapp at : is either no Android app project or build version has not been set to override. Skipping...
Configure project :@react-native-community_async-storage
Project @react-native-community_async-storage at :@react-native-community_async-storage is either no Android app project or build version has not been set to override.
* What went wrong:
Execution failed for task ':app:***'.
Could not resolve all files for configuration ':app:lintClassPath'.
Could not download groovy-all.jar (org.codehaus.groovy:groovy-all:2.4.15)
Could not get resource 'https://jcenter.bintray.com/org/codehaus/groovy/groovy-all/2.4.15/groovy-all-2.4.15.jar'.
Could not GET 'https://jcenter.bintray.com/org/codehaus/groovy/groovy-all/2.4.15/groovy-all-2.4.15.jar'.

この問題は、JFrog が 2021 年 5 月 1 日に JCenter (Bintray の一部) をシャットダウンしたことが原因で発生します。 このサイトでは Android 成果物の大部分がホストされていたため、JCenter は Android 開発の重要な部分でした。 Android 開発者は、一部の古いライブラリが維持されなくなったことを念のために、ライブラリを Maven Central に移植する必要があります。 これらの投稿では、ビルド パイプラインの中断を回避するために知っておくべきことと実行する必要がある内容が示されます。