Could not resolve all artifacts for configuration ‘:classpath’ でビルドエラー
- 2018.10.24
- Android
現象
- ローカルのiMacではビルドできるが、CI上で突如2018/10/23からビルドでこけるようになった
- MBPでまっさらな環境で手動ビルドすると掲題の同じエラー
条件
- AndroidStudio3.2.1
- Java1.8.0_152
- compileSDK:26
- targetSDK:26
- gradle 4.10.2
エラー詳細
1 2 3 4 5 6 7 8 9 |
FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root project 'XXProject'. > Could not resolve all artifacts for configuration ':classpath'. > Could not find aapt2-proto.jar (com.android.tools.build:aapt2-proto:0.3.1). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/build/aapt2-proto/0.3.1/aapt2-proto-0.3.1.jar |
対策
google()リポジトリを以下のようにjcenter()よりも上にもってくればOK
Before
1 2 3 4 5 6 |
buildscript { repositories { jcenter() google() } |
After
1 2 3 4 5 6 |
buildscript { repositories { google() jcenter() } |
まとめ
解決のリンクにいきつくまで結構時間をとられてしまった。
-
前の記事
Kotlin移行8 2018.10.14
-
次の記事
Unable to instantiate application com.android.tools.fd.runtime.BootstrapApplication 2018.10.26
コメントを書く