构建项目 android 时出现重复 class 错误
Duplicate class error while building project android
我正在构建我的项目并收到以下重复错误 class
Duplicate class android.support.customtabs.ICustomTabsCallback found in modules browser-1.4.0-runtime (androidx.browser:browser:1.4.0) and customtabs-26.1.0-runtime (com.android.support:customtabs:26.1.0)
Duplicate class android.support.customtabs.ICustomTabsCallback$Stub found in modules browser-1.4.0-runtime (androidx.browser:browser:1.4.0) and customtabs-26.1.0-runtime (com.android.support:customtabs:26.1.0)
Duplicate class android.support.customtabs.ICustomTabsCallback$Stub$Proxy found in modules browser-1.4.0-runtime (androidx.browser:browser:1.4.0) and customtabs-26.1.0-runtime (com.android.support:customtabs:26.1.0)
Duplicate class android.support.customtabs.ICustomTabsService found in modules browser-1.4.0-runtime (androidx.browser:browser:1.4.0) and customtabs-26.1.0-runtime (com.android.support:customtabs:26.1.0)
Duplicate class android.support.customtabs.ICustomTabsService$Stub found in modules browser-1.4.0-runtime (androidx.browser:browser:1.4.0) and customtabs-26.1.0-runtime (com.android.support:customtabs:26.1.0)
Duplicate class android.support.customtabs.ICustomTabsService$Stub$Proxy found in modules browser-1.4.0-runtime (androidx.browser:browser:1.4.0) and customtabs-26.1.0-runtime (com.android.support:customtabs:26.1.0)
Duplicate class android.support.customtabs.IPostMessageService found in modules browser-1.4.0-runtime (androidx.browser:browser:1.4.0) and customtabs-26.1.0-runtime (com.android.support:customtabs:26.1.0)
Duplicate class android.support.customtabs.IPostMessageService$Stub found in modules browser-1.4.0-runtime (androidx.browser:browser:1.4.0) and customtabs-26.1.0-runtime (com.android.support:customtabs:26.1.0)
Duplicate class android.support.customtabs.IPostMessageService$Stub$Proxy found in modules browser-1.4.0-runtime (androidx.browser:browser:1.4.0) and customtabs-26.1.0-runtime (com.android.support:customtabs:26.1.0)
Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-compat-26.1.0-runtime (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-compat-26.1.0-runtime (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-compat-26.1.0-runtime (com.android.support:support-compat:26.1.0)
这些是我的 gradle 依赖项
dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation files('libs/release.aar')
implementation "androidx.browser:browser:1.3.0"
implementation "com.google.android.gms:play-services-ads:16.0.0"
implementation "com.google.android.gms:play-services-location:16.0.0"
implementation "com.google.android.exoplayer:exoplayer:2.17.1"
implementation "com.google.android.exoplayer:extension-ima:2.17.1"
}
可以通过在 gradle.properties
文件中添加 android.enableJetifier=true
来解决
我正在构建我的项目并收到以下重复错误 class
Duplicate class android.support.customtabs.ICustomTabsCallback found in modules browser-1.4.0-runtime (androidx.browser:browser:1.4.0) and customtabs-26.1.0-runtime (com.android.support:customtabs:26.1.0)
Duplicate class android.support.customtabs.ICustomTabsCallback$Stub found in modules browser-1.4.0-runtime (androidx.browser:browser:1.4.0) and customtabs-26.1.0-runtime (com.android.support:customtabs:26.1.0)
Duplicate class android.support.customtabs.ICustomTabsCallback$Stub$Proxy found in modules browser-1.4.0-runtime (androidx.browser:browser:1.4.0) and customtabs-26.1.0-runtime (com.android.support:customtabs:26.1.0)
Duplicate class android.support.customtabs.ICustomTabsService found in modules browser-1.4.0-runtime (androidx.browser:browser:1.4.0) and customtabs-26.1.0-runtime (com.android.support:customtabs:26.1.0)
Duplicate class android.support.customtabs.ICustomTabsService$Stub found in modules browser-1.4.0-runtime (androidx.browser:browser:1.4.0) and customtabs-26.1.0-runtime (com.android.support:customtabs:26.1.0)
Duplicate class android.support.customtabs.ICustomTabsService$Stub$Proxy found in modules browser-1.4.0-runtime (androidx.browser:browser:1.4.0) and customtabs-26.1.0-runtime (com.android.support:customtabs:26.1.0)
Duplicate class android.support.customtabs.IPostMessageService found in modules browser-1.4.0-runtime (androidx.browser:browser:1.4.0) and customtabs-26.1.0-runtime (com.android.support:customtabs:26.1.0)
Duplicate class android.support.customtabs.IPostMessageService$Stub found in modules browser-1.4.0-runtime (androidx.browser:browser:1.4.0) and customtabs-26.1.0-runtime (com.android.support:customtabs:26.1.0)
Duplicate class android.support.customtabs.IPostMessageService$Stub$Proxy found in modules browser-1.4.0-runtime (androidx.browser:browser:1.4.0) and customtabs-26.1.0-runtime (com.android.support:customtabs:26.1.0)
Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-compat-26.1.0-runtime (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-compat-26.1.0-runtime (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-compat-26.1.0-runtime (com.android.support:support-compat:26.1.0)
这些是我的 gradle 依赖项
dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation files('libs/release.aar')
implementation "androidx.browser:browser:1.3.0"
implementation "com.google.android.gms:play-services-ads:16.0.0"
implementation "com.google.android.gms:play-services-location:16.0.0"
implementation "com.google.android.exoplayer:exoplayer:2.17.1"
implementation "com.google.android.exoplayer:extension-ima:2.17.1"
}
可以通过在 gradle.properties
文件中添加 android.enableJetifier=true
来解决