Gradle Sync failed could not find constraint-layout:1.0.0-alpha2

后端 未结 22 2171
忘了有多久
忘了有多久 2020-11-27 17:39

Problem :

Error:Could not find com.android.support.constraint:constraint-layout:1.0.0-alpha2.
Required by:
myapp:app:unspecified


        
相关标签:
22条回答
  • 2020-11-27 17:41

    In my case, I was using AS 2.3 and I wanted to use the currently latest ConstraintLayout 1.1.3, but the latest version in my Preferences > Appearance & Behavior > System Settings > Android was 1.0.2.

    To use ConstraintLayout 1.1.3, I updated my AS from 2.3 to currently latest 3.2.1, com.android.tools.build:gradle from 2.2.2 to 3.2.1, gradle from 3.3 to 4.6 and buildToolsVersion from 25.0.0 to 28.0.3.

    I also added maven { url 'https://maven.google.com' } to the Maven repositories in the project-level build.gradle file and that solved my problem.

    0 讨论(0)
  • 2020-11-27 17:41

    Not sure if I'm too late, but in case someone has still the error after an update of ConstraintLayout and Solver over the SDK Tools, maybe this solution could help: Error:(30, 13) Failed to resolve: com.android.support.constraint:constraint-layout:1.0.0-alpha4

    0 讨论(0)
  • 2020-11-27 17:44

    Its available in androidx as following package

    implementation "androidx.constraintlayout:constraintlayout:2.0.0-alpha1"
    
    0 讨论(0)
  • 2020-11-27 17:45

    For me it was a completely different issue. When I installed constraint dependancy in SDK tools, the tools somehow wrote them into the wrong directory. That is

    /home/${USER}/Android/Sdk/extras/+m2repository+/com/.../constraint

    instead of

    /home/${USER}/Android/Sdk/extras/+android+/+m2repository+/com/.../constraint

    Remedy:

    Just copy the 1.0.0-alpha* directories into the latter path

    0 讨论(0)
  • 2020-11-27 17:46

    gradle com.android.tools.build:gradle:2.2.0-alpha6

    constraint layout dependency com.android.support.constraint:constraint-layout:1.0.0-alpha4

    works for me

    0 讨论(0)
  • 2020-11-27 17:48

    Similar issue solved by Reinstalling Android Studio.

    0 讨论(0)
提交回复
热议问题