Failed to sync Gradle project 'XX'错误解决

时间:2021-08-30 09:06:27

错误代码

Failed to sync Gradle project 'WeChat'
Error:Failed to find target with hash string 'android-24' in: E:SoftAndroidsdk
<a href="install.android.platform">Install missing platform(s) and sync project</a>

Failed to sync Gradle project 'XX'错误解决

提示SDK下面没有android-24

解决方法:

1.打开项目APP下的build.gradle文件

Failed to sync Gradle project 'XX'错误解决

2.红箭头指的三个地方要修改为你安卓SDK有的版本

Failed to sync Gradle project 'XX'错误解决

Failed to sync Gradle project 'XX'错误解决

3.把SDK版本修改到build.gradle里去

Failed to sync Gradle project 'XX'错误解决

问题成功解决下面以图为证:

Failed to sync Gradle project 'XX'错误解决