【问题标题】:can't sync project after adding constraintLayout添加约束布局后无法同步项目
【发布时间】:2020-06-14 19:16:14
【问题描述】:

添加后

implementation'androidx.constraintlayout:constraintlayout:2.0.0-beta4'

android studio 无法同步,我收到此错误:

错误:无法解决:核心

下面是我所有的依赖:

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.android.material:material:1.2.0-alpha05'
implementation 'com.android.volley:volley:1.1.1'
}

我应该提一下,如果我将 constrainLayout 降级到 beta1,它运行良好!

【问题讨论】:

    标签: gradle kotlin android-gradle-plugin android-constraintlayout android-motionlayout


    【解决方案1】:

    似乎 constrainLayout alpha 和 core 1.2.0 存在一些错误, 所以我改变了核心:

    'androidx.core:core-ktx:1.2.0'
    

      implementation 'androidx.core:core-ktx:1.3.0-alpha01'
    

    它解决了这个问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多