LoginSignup
0
0

More than 5 years have passed since last update.

[React Native] 突然 Could not find any matches for com.android.tools.build:gradle:2.3.+ as no versions of com.android.tools.build:gradle are available.

Last updated at Posted at 2018-12-11

React Nativeのプロジェクト開発してますが、今日突然以下のエラーが発生してビルドできなくなってしまいました。

A problem occurred configuring project ':react-native-vector-icons'.
> Could not resolve all artifacts for configuration ':react-native-vector-icons:classpath'.
   > Could not find any matches for com.android.tools.build:gradle:2.3.+ as no versions of com.android.tools.build:gradle are available.
     Required by:
         project :react-native-vector-icons

このメッセージだとreact-native-vector-iconsのパッケージですが、他にもいくつかのパッケージで同じエラーが発生します。

ここを参考に、android/build.gradle (app/以下でない) に以下を追記することで修正できました。

subprojects {
    if (project.name.contains('react-native-vector-icons')) {
        buildscript {
            repositories {
                jcenter()
                maven { url "https://dl.bintray.com/android/android-tools/"  }
            }
        }
    }
    // 同様のエラーが発生するパッケー分追記する
}

あ、gradleのキャッシュ削除も必要かもです。

rm -rf $HOME/.gradle/caches/

どこかのリポジトリから gradle 2.3.x が消えてしまったのでしょうか?
よくわかりませんがとりあえず解決したよってことで!

ライブラリ側の更新でそのうちこの記述は不要になるとは思いますが。。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0