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
- As Error:Could not determine the class-path for interface com.android.builder.model.AndroidProject.
- Failed to find target with hash string ‘android-25’ in:D:\SDK
- Android studio failed to resolve: junit:junit : 4.12 solutions
- Add a warehouse in allprojects repositories and report an error
- Failed to resolve: com.github
- Failed to find target with hash string”android-21″ in:D:\AndroidVersionSdk
- About Android studio error: (26,13) failed to resolve: com.android.support : appcompat-v7:27. + error
- Solution to the expiration and unavailability of Android studio plug-in plugin
- Errorjava.lang.NullPointerException(no error message)
- [error record] as compilation error (Android support plugin version is too high | upgrade Android studio to the latest version)
- AndroidStudio sync failed solution
- failed to resolve:com.github.********
- How to Fix com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
- ERROR: Unsupported method: AndroidProject.getVariantNames().
- Error:Cause: buildToolsVersion is not specified.
- 2021-07-27 Android studio:Installed build tools revision 31.0.0 is corrupted.Remove and install ag
- Some processing experiences of failed to notify build listener