時間:2019/12/7
最近在做安卓大作業時總是遇到從GitHub上下載下來的demo不能在本地Android studio中運行的問題,感覺真的被安卓中的各種版本給惡心到了,下面記錄其中比較典型的一個問題.
報錯如下:
Could not find com.android.tools.build:gradle:3.5.0. Searched in the following locations: https://jcenter.bintray.com/com/android/tools/build/gradle/3.5.0/gradle-3.5.0.pom https://jcenter.bintray.com/com/android/tools/build/gradle/3.5.0/gradle-3.5.0.jar Required by: project : Add Google Maven repository and sync project Open File
解決方法如下:
1.打開下圖所示文件:
2.注釋掉release中的內容
3.加入repostories
1 repositories { 2 3 maven { 4 5 url "https://maven.google.com" 6 7 } 8 9 }
4.重新編譯gradle
注:上述步驟都是在各種版本號配置好之后的措施