问题解决-Failed to resolve: com.android.support.constraint:constraint-layout:1.0.0-alpha7

将相本无种,男儿当自强。这篇文章主要讲述问题解决-Failed to resolve: com.android.support.constraint:constraint-layout:1.0.0-alpha7相关的知识,希望能为你提供帮助。
Failed to resolve: com.android.support.constraint:constraint-layout:1.0.0-alpha7     依赖constraintLayout报错
1.原因分析:
  使用ConstraintLayout需要在gradle中添加依赖。
compile‘com.android.support.constraint:constraint-layout:1.0.0-alpha7‘
clone别人的项目时发现报错误:

Failed to resolve:com.android.support.constraint:constraint-layout:1.0.0-alpha7
或Could not find com.android.support.constraint:constraint-layout:1.0.0-alpha7


 是因为AndroidStudio更新到2.3版本,ConstraintLayout跟着更新到了1.0.1,所以报错了

2.解决办法:
工具栏上选择 Tools --> Android --> SDK Manager 切换到SDK Tools选项
在右下角处勾选 Show Package Details,
在Support Repository下的ConstraintLayout for Android 和 Solver for ConstraintLayout 中选中自己需要的版本(gradle中依赖的版本)
点OK,再同步gradle就可以了。

问题解决-Failed to resolve: com.android.support.constraint:constraint-layout:1.0.0-alpha7

文章图片

【问题解决-Failed to resolve: com.android.support.constraint:constraint-layout:1.0.0-alpha7】 









    推荐阅读