导入项目的时候报错Error:Could not find com.android.support.constraint:constraint-layout:1.0.0-alpha7

时间:2023-03-09 20:03:37
导入项目的时候报错Error:Could not find com.android.support.constraint:constraint-layout:1.0.0-alpha7

问题描述

今天在导入项目的时候报错:

Error:Could not find com.android.support.constraint:constraint-layout:1.0.0-alpha7.

导入项目的时候报错Error:Could not find com.android.support.constraint:constraint-layout:1.0.0-alpha7

原因是:没有下载相应版本的ConstraintLayout。

解决方案

工具栏上选择 Tools --> Android -->SDK Manager

导入项目的时候报错Error:Could not find com.android.support.constraint:constraint-layout:1.0.0-alpha7

切换到SDK Tools选项,在右下角处勾选 Show Package Details

导入项目的时候报错Error:Could not find com.android.support.constraint:constraint-layout:1.0.0-alpha7

Support Repository下的ConstraintLayout for Android 和 Solver for ConstraintLayout 中选中自己需要的版本(gradle中依赖的版本)

导入项目的时候报错Error:Could not find com.android.support.constraint:constraint-layout:1.0.0-alpha7

点OK进行下载

导入项目的时候报错Error:Could not find com.android.support.constraint:constraint-layout:1.0.0-alpha7

导入项目的时候报错Error:Could not find com.android.support.constraint:constraint-layout:1.0.0-alpha7

再同步gradle就可以了

导入项目的时候报错Error:Could not find com.android.support.constraint:constraint-layout:1.0.0-alpha7

参考资料

依赖ConstraintLayout报错,Could not find *****,Failed to resolve:*****