Android new project error Could not resolve com.android.tools.build:aapt2***

A new Android project, or a new imported project, has an error during the compilation process,
prompting Could not resolve com.android.tools.build:aapt2:

The solution I encountered:

1. Modify the version number below in the build.gradle file in the project root directory

classpath 'com.android.tools.build:gradle:***' 
2. Modify the gradle-wrapper.properties file 
distributionUrl=https\://services.gradle.org/distributions/gradle-* under the project gradle\wrapper directory **-bin.zip

Change the above two version numbers accordingly. For the corresponding relationship between the two version numbers, please refer to the required version of Gradle corresponding to the Android Gradle plugin in the following blog address_Shuaici 's Blog-CSDN Blog_The version corresponding to the gradle version number

 

Guess you like

Origin blog.csdn.net/hnlht/article/details/128238926