2016-10-20 34 views
5

Screen Shot #1 - Android Studio Project Gradle Build ViewAndroid的工作室 - 錯誤:無法解析:com.android.support.constraint:約束的佈局:1.0.0-α1

Screen Shot #2 - Android Studio Project Gradle Sync View

通過的 「Android Studio 2.2中發展綱要書」 走出去並在第3章的一切教程下面一起被確定,直到我完成了在發展Essentials一書(第3章,24頁書),上述任務,

As we can see from the component tree hierarchy, the user interface layout consists of a layout parent with a single child in the form of a TextView object. If Android Studio has used a RelativeLayout manager for the project, the first step is to convert it to a ConstraintLayout. ConstraintLayout is a new and flexible layout manager that is used in most projects in this book. To achieve this conversion, right-click on the content_android_sample entry in the Component Tree and select the Convert RelativeLayout to ConstraintLayout menu option as shown below:

若以上引述的教程任務完成(在第二章噸。發展Essentials一書3),提出一個錯誤,說:

錯誤:無法解析:com.android.support.constraint:約束的佈局:1.0.0-α1

此外,上市渲染錯誤以及謂曰:

呈現問題以下類找不到: - android.support.constraint.ConstraintLayout(添加約束的佈局庫相關的項目,修復建設路徑,編輯XML,創建C lass)

有關如何解決這個問題的想法?請看附上的屏幕截圖(上圖)。我是Android Studio的新手。

非常感謝您的時間。

我使用下面的OS和Android的下方Studio版本:

Win7專業版64位操作系統

的Android Studio 2.2中

構建#AI-145,3330264,建於2016年10月6日

回答

19

您需要添加檢查..

存在名稱爲「SDK管理器」一圖標只需點擊

開放Settings -> Appearance & Behavior -> System Settings -> Android SDK -> SDK Tools

而在此對話框中添加:

  • ConstraintLayout爲Android
  • 解算器ConstrainLayout

enter image description here

然後,這裏只需要關閉和開啓Android Studio。

也許只有你可以更新到:

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

3

或更新您的依賴關係:

compile 'com.android.support.constraint:constraint-layout:1.0.2' 
+0

這取決於安裝在本地計算機上的版本。 – pram

相關問題