play-services-ads conflicts with appcompat

前端 未结 1 575
不思量自难忘°
不思量自难忘° 2020-11-28 16:18

When I add implementation \'com.google.android.gms:play-services-ads:18.2.0\' to my build.gradle, Android Studio highlights implementation \'com.android.s

相关标签:
1条回答
  • 2020-11-28 16:58

    You are using

    implementation 'com.google.android.gms:play-services-ads:18.2.0'
    

    Google Play services migrated to AndroidX in the latest release.

    Dependencies using groupId com.android.support and androidx.* can not be combined

    It means that you are using both, support libraries and androidx libraries.

    You can:

    • migrate to androidx as described below (in your case you have to migrate appcompat to implementation 'androidx.appcompat:appcompat:1.0.2')
    • downgrade your google play ads dependencies (but it is not a real solution because you have to migrate sooner or later)

    You can check the official release notes:

    Warning: This release is a MAJOR version update and breaking change. The latest update to Google Play services and Firebase includes the following changes:

    Migration from Android Support Libraries to Jetpack (AndroidX) Libraries. Libraries will not work unless you make the following changes in your app:

    • Upgrade com.android.tools.build:gradle to v3.2.1 or later.
    • Upgrade compileSdkVersion to 28 or later.
    • Update your app to use Jetpack (AndroidX); follow the instructions in Migrating to AndroidX.
    0 讨论(0)
提交回复
热议问题