Error:Program type already present: android.arch.lifecycle.LiveData

前端 未结 10 930
迷失自我
迷失自我 2020-12-06 04:32

When I press the run button in Android Studio, my app compiles but shows this error (redacted):

Error:Program type a         


        
10条回答
  •  有刺的猬
    2020-12-06 05:02

    In my case, bumping targetSdkVersion and compileSdkVersion to 28, as well as using version 28 of all support libraries fixed the issue.


    I encountered this when I upgraded Glide. I got an error regarding a duplicate CoordinatorLayout. I solved that by using com.android.support:design:27.1.0, but then I got another error regarding LiveData$LifecycleBoundObserver.

    After a few hours, I gave up and upgraded targetSdkVersion and compileSdkVersion to API 28, as well as using

    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'
    

    because YOLO. By dumb luck, it worked.

提交回复
热议问题