之前在github上通过import module导入一个项目,结果报错,提示找不到sdk相应的版本xx,而我的compileSdkVersion明明写的是23不是xx,查了半天也没解决。最后只好下载了那个版本的sdk。

今天导入SlidingMenu的module的时候,又遇到了这个问题。

 

 问题:

解决android studio项目中Failded to sync Gradle project 'XXXX'  Cause:failed to find target with hash string 'android-16'问题

解决android studio项目中Failded to sync Gradle project 'XXXX'  Cause:failed to find target with hash string 'android-16'问题

Cause:failed to find target with hash string 'android-16' in: E:\sony\Android\sdk

failed to find Build Tools revision 19.1.0

 

而build.gradle文件中的版本号明明是23,不是16,版本号对应不起来,

解决android studio项目中Failded to sync Gradle project 'XXXX'  Cause:failed to find target with hash string 'android-16'问题

项目中有不止一个.gradle文件,是不是导入的module也有?果然如此。

 

解决:

原因是你导入的module也有build.gradle文件,计算机中缺少这个文件中标记的compileSdkVersion为16的sdk。

导入的module中build.gradle文件的compileSdkVersion和buildToolsVersion版本号的问题,不是app那个module的build.gradle文件的版本号的问题。

解决android studio项目中Failded to sync Gradle project 'XXXX'  Cause:failed to find target with hash string 'android-16'问题解决android studio项目中Failded to sync Gradle project 'XXXX'  Cause:failed to find target with hash string 'android-16'问题

修改导入的module的build.gradle中的版本号为你已有的sdk版本号即可。

 

相关文章:

  • 2021-07-21
  • 2021-04-13
  • 2022-12-23
  • 2021-12-21
  • 2021-08-06
  • 2021-12-29
  • 2021-10-06
猜你喜欢
  • 2021-08-01
  • 2021-07-15
  • 2021-06-09
  • 2021-04-08
  • 2021-11-25
  • 2022-12-23
  • 2021-12-21
相关资源
相似解决方案