解決android studio項目中Failded to sync Gradle project 'XXXX' Cause:failed to find target with hash string 'android-16'問題

來源:互聯網
上載者:User

標籤:

之前在github上通過import module匯入一個項目,結果報錯,提示找不到sdk相應的版本xx,而我的compileSdkVersion明明寫的是23不是xx,查了半天也沒解決。最後只好下載了那個版本的sdk。

今天匯入SlidingMenu的module的時候,又遇到了這個問題。

 

 問題:

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,版本號碼對應不起來,

項目中有不止一個.gradle檔案,是不是匯入的module也有?果然如此。

 

解決:

原因是你匯入的module也有build.gradle檔案,電腦中缺少這個檔案中標記的compileSdkVersion為16的sdk。

是匯入的module中build.gradle檔案的compileSdkVersion和buildToolsVersion版本號碼的問題,不是app那個module的build.gradle檔案中的版本號碼的問題。

修改匯入的module的build.gradle中的版本號碼為你已有的sdk版本號碼即可。

 

解決android studio項目中Failded to sync Gradle project 'XXXX' Cause:failed to find target with hash string 'android-16'問題

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.