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

后端 未结 22 2105
忘了有多久
忘了有多久 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:49

    i'm try constraint layout dependency update available 1,and plugin gradle alpha-6,it worked

    0 讨论(0)
  • 2020-11-27 17:50
    1. Ensure you have the maven.google.com repository declared in your module-level build.gradle file

      repositories { maven { url 'https://maven.google.com' } }

    2.Add the library as a dependency in the same build.gradle file:

    dependencies {
          compile 'com.android.support.constraint:constraint-layout:1.0.2'
    }
    
    0 讨论(0)
  • 2020-11-27 17:52

    The fix is to update the android gradle plugin in your build.gradle.

    This should work: classpath 'com.android.tools.build:gradle:2.2.0-alpha2'

    Or you can use the latest: classpath 'com.android.tools.build:gradle:2.2.0-alpha3'

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

    In my case, I had to remove the previous versions first and download the latest one instead. v1.0 stable was released on Feb 23rd.

    0 讨论(0)
  • 2020-11-27 18:00

    In my case, I had a multi-module project called "app" and "sdk". The "sdk" module is the one where I had added the constraint layout library. I got the error when I tried to incorporate "sdk" into a new multi-module project called "app2". The solution was to ensure I had added the Google Maven Repository to the project-level build.gradle file for "app2". The Google Maven Repository can be added by putting "google()" under allprojects.repositories in the project-level build.gradle file:

    allprojects {
        repositories {
            jcenter()
            google()
        }
    }
    
    0 讨论(0)
  • 2020-11-27 18:02

    Just to make sure that in studio version 2.3 you won't see a dropdown near constraint-layout in sdk tools, it will by default install the latest version

    To get the desired version check the box saying show package details and boom you can now choose the desired version you want to install

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