依賴ConstraintLayout報錯,Could not find *****,Failed to resolve:*****,constraintlayout

來源:互聯網
上載者:User

依賴ConstraintLayout報錯,Could not find *****,Failed to resolve:*****,constraintlayout

  ConstraintLayout 約束布局,AndroidStudio2.2中新增功能之一,可以先去看看這篇文章 Android新特性介紹,ConstraintLayout完全解析,2.3版本的AndroidStudio支援在約束布局中使用 Chains(連結) 和 Ratio(比例) 。

  使用ConstraintLayout可以在gradle中添加依賴。

    compile 'com.android.support.constraint:constraint-layout:1.0.0-beta5'

  clone別人的項目時發現報錯誤:

    Failed to resolve:com.android.support.constraint:constraint-layout:1.0.0-beta5      或    Could not find com.android.support.constraint:constraint-layout:1.0.0-beta5    AndroidStudio更新到2.3版本,ConstraintLayout跟著更新到了1.0.1,所以報錯了   解決辦法: 工具列上選擇 Tools --> Android -->SDK Manager 切換到SDK Tools選項  在右下角處勾選 Show Package Details,    在Support Repository下的ConstraintLayout for Android 和 Solver for ConstraintLayout 中選中自己需要的版本(gradle中依賴的版本)  點OK,再同步gradle就可以了。 

  搞定。

     

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.