Android development issue record: app:checkDebugDuplicateClasses

Error reported during development:

Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-v4-21.0.3-runtime (com.android.support:support-v4:21.0.3)

Insert image description here

According to what I found on the Internet: The newly introduced package uses the android.support package, and our project project has been migrated to androidx as a whole. The two libraries overlap in function, which resulted in the above error report. But I tried it and it
was Useful
Android official provides a way for this situation. Add these two lines to the gradle.properties file in the project root directory.

android.useAndroidX=true//是否使用androidx    
android.enableJetifier=true//是否将引入的第三方库中的android.support强制转为androidx

Insert image description here

Guess you like

Origin blog.csdn.net/weixin_74239923/article/details/132325351