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

后端 未结 22 2278
忘了有多久
忘了有多久 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 18:06

    In my case, that support libraries for ConstraintLayout were installed, but I was adding the incorrect version of ConstraintLayout Library in my build.gradle file. In order to see what version have you installed, go to Preferences > Appearance & Behavior > System Settings > Android SDK. Now, click on SDK Tools tab in right pane. Check Show Package Details and take note of the version.

    Finally you can add the correct version in the build.gradle file

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha9'
        testCompile 'junit:junit:4.12'
    }
    

提交回复
热议问题