Could not find support-media-compat.aar
- 2019 年 10 月 25 日
- 筆記
說實話這個錯報了好久了,由於進行了別的項目開發就一直也沒去管他,今天再次打開項目,又見到了熟悉的這個錯,於是解決並記錄下來。

報錯如圖
解決辦法: 將項目的build.gradle中 buildscript{ ** } allprojects{ ** } 的goodle放到第一位即可 參考配置如下
// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.1.4' classpath 'com.jakewharton:butterknife-gradle-plugin:8.8.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { google() jcenter() maven { url "https://jitpack.io" } maven { url "https://maven.google.com" } maven { url "https://dl.google.com/dl/android/maven2/"} } } task clean(type: Delete) { delete rootProject.buildDir }
