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

Posted 叶秋1022

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了问题解决-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的问题解决

Failed to resolve: com.android.support:appcompat-v7:27.0.1问题解决

解决 Android Studio:Failed to resolve: com.android.support:appcompat-v7:29.+ 错误

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

springBoot测试类报Failed to resolve org.junit...错误

Failed to resolve: com.android.support:appcompat-v7:27.+