Program type already present: android.support.constraint.BuildConfig

前端 未结 3 1483
谎友^
谎友^ 2021-02-19 19:07

build.gradle (Module: app)

apply plugin: \'com.android.application\'

android {
    compileSdkVersion \'android-P\'
    buildToolsVersion \'27.0         


        
相关标签:
3条回答
  • 2021-02-19 19:31

    Be careful not to reference com.android.support.constraint:constraint-layout and androidx.constraintlayout:constraintlayout at the same time. Settle on one (preferably androidx), remove the other, and make sure the package names are consistent in your layout files too. That fixed the issue for me.

    0 讨论(0)
  • 2021-02-19 19:35

    I also had the same issue. I was using two different versions for android.arch.core library.So,fixing those versions helped me.Try to use one version throughout your application.Hope it helps someone.

    Thanks

    0 讨论(0)
  • 2021-02-19 19:50

    The errors indicate that you're using the ConstraintLayout in your layout xml files.

    Keep only one version of the library and make sure, that you are using that version's ConstraintLayout in your xmls.

    So, if you keep androidx, check your layout files and make sure, you are using androidx.constraintlayout.ConstraintLayout there, and not android.support.constraint.ConstraintLayout.

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