gpt4 book ai didi

android-studio-2.2 - Android Studio - 错误 : Failed to resolve: com. android.support.constraint :constraint-layout:1. 0.0-alpha1

转载 作者:行者123 更新时间:2023-12-04 09:10:23 25 4
gpt4 key购买 nike

Screen Shot #1 - Android Studio Project Gradle Build View

Screen Shot #2 - Android Studio Project Gradle Sync View

阅读“Android Studio 2.2 Development Essentials book”并遵循第 3 章中的教程。一切都很好,直到我完成了 Development 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:



完成上述引用的教程任务后(在 Development Essentials 书的第 3 章),出现了一个错误:

错误:无法解析:com.android.support.constraint:constraint-layout:1.0.0-alpha1

此外,还列出了一个渲染错误,表示:

渲染问题找不到以下类:
- android.support.constraint.ConstraintLayout(向项目添加约束布局库依赖项,修复构建路径,编辑 XML,创建类)


关于如何解决这个问题的任何想法?请参阅附上的屏幕截图(上)。我是 Android Studio 的新手。

非常感谢您的宝贵时间。

我正在使用以下操作系统和 Android Studio 版本:

Win7 专业版 64 位操作系统

安卓工作室 2.2

Build# AI-145,3330264,建于 2016 年 10 月 6 日

最佳答案

您需要添加 checkin ..

存在一个名为“SDK Manager”的图标,只需单击

打开 Settings -> Appearance & Behavior -> System Settings -> Android SDK -> SDK Tools
并在此对话框中添加:

  • 适用于 Android 的 ConstraintLayout
  • ConstrainLayout 的求解器

  • enter image description here

    然后,这里只需要关闭并打开 Android Studio。

    也许只有您可以更新为:
    compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha8'

    关于android-studio-2.2 - Android Studio - 错误 : Failed to resolve: com. android.support.constraint :constraint-layout:1. 0.0-alpha1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40160968/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com