After initializing a project using Android Studio, you need to sync the app/build.gradle file, but it will report an error such as:
Failed to resolve: com.android.support:appcompat-v7:26.0.0
What is the reason for this?
If your Android SDK is greater than 26.0.0, you will need to add the following statements in build.Gradle in the root directory of your project:
...
allprojects {
repositories {
...
maven {
url "https://maven.google.com"
}
}
}
...
Refer to the link
In addition, if it still doesn’t work, let’s see if the SDK version is correct. In app/build.gradle, there is a column of data that is buildToolsVersion
, and we should write its SDK version
Read More:
- Failed to resolve: com.android.support:appcompat-v7:25.3.0
- About Android studio error: (26,13) failed to resolve: com.android.support : appcompat-v7:27. + error
- Failed to resolve: com.android.support:appcompat-v7:27.
- [error log] 27.1.0 series of errors Error:Failed to resolve: com.android.support :support-an notations:27.1.0
- Android project error: could not resolve com.android.support .c onstraint:constraint-layout :2.0.2.
- android studio Error Gradle project sync failed. Please fix your project and try again
- Android studio failed to resolve: com.github.CymChad :BaseRecyclerViewAdap terHelper:2.9.46
- Android studio “sync project with gradle files” button disappears
- [Solved] Android gradle Error: gradle project sync failed. Please fix your project and try again
- Android studio failed to resolve: junit:junit : 4.12 solutions
- [error record] as compilation error (Android support plugin version is too high | upgrade Android studio to the latest version)
- Error in Cordova project execution command after Android studio upgrade: could not find gradle wrapper within Android SDK
- How to Fix Android Error:This Gradle plugin requires Studio 3.0 minimum
- Android Studio | Failed to find target with hash string ‘android-26’ in: D:\Android\sdk
- android studio:Error inflating class android.support.v4.widget.SwipeRefreshLayout
- Solve Android studio connection dl.google.com Timeout problem
- How to Fix com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
- [actual record of Android stepping on the pit] Android studio reports an error invalid gradle JDK configuration found after importing the project
- 2021-07-27 Android studio:Installed build tools revision 31.0.0 is corrupted.Remove and install ag
- [problem record] installed build tools revision 31.0.0 is broken during Android studio compilation