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

后端 未结 22 2272
忘了有多久
忘了有多久 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: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()
        }
    }
    

提交回复
热议问题