【问题标题】:implementation 'com.jmedeisis:draglinearlayout:1.1.0' showing error实现 'com.jmedeisis:draglinearlayout:1.1.0' 显示错误
【发布时间】:2021-07-22 13:43:27
【问题描述】:

开始了一个新的空白模板项目,在添加了 draglinearlayout 依赖项之后,我开始遇到这些错误,而在添加这个依赖项之前,我运行了我的项目并且它运行良好。错误如下

任务“:app:checkDebugDuplicateClasses”执行失败。 执行 com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable 时发生故障 在模块 core-1.5.0-runtime (androidx.core:core:1.5.0) 和 support-v4-22.1.1-runtime (com.android.support:support -v4:22.1.1) 在模块 core-1.5.0-runtime (androidx.core:core:1.5.0) 和 support-v4-22.1.1-runtime (com.android.support :support-v4:22.1.1) 重复类 android.support.v4.app.INotificationSideChannel$Stub$Proxy 在模块 core-1.5.0-runtime (androidx.core:core:1.5.0) 和 support-v4-22.1.1-runtime (com.android .support:support-v4:22.1.1)

  • 尝试: 使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。

这是我遇到的错误

这是我的模块成绩文件

plugins {
   id 'com.android.application'
}

android {
   compileSdkVersion 30
   buildToolsVersion "30.0.3"

   defaultConfig {
       applicationId "com.ujjwal.drag_and_drop"
       minSdkVersion 19
       targetSdkVersion 30
       versionCode 1
       versionName "1.0"

       testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
   }

   buildTypes {
       release {
           minifyEnabled false
           proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
       }
   }
   compileOptions {
       sourceCompatibility JavaVersion.VERSION_1_8
       targetCompatibility JavaVersion.VERSION_1_8
   }
}

dependencies {

   implementation 'com.jmedeisis:draglinearlayout:1.1.0'
   implementation 'androidx.appcompat:appcompat:1.3.0'
   implementation 'com.google.android.material:material:1.4.0'
   implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
   testImplementation 'junit:junit:4.13.2'
   androidTestImplementation 'androidx.test.ext:junit:1.1.3'
   androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

【问题讨论】:

    标签: java android android-studio kotlin


    【解决方案1】:

    Android 有一个解决这个问题的方法,一个新的 Android 项目使用 AndroidX 和一些使用旧版 android 支持库的旧库,你就是这种情况。

    解决方案是在您的gradle.properties 中启用 Jetifier,如下所示:

    android.enableJetifier=true
    

    您可以在以下两个帖子中找到更多信息:

    【讨论】:

      猜你喜欢
      • 2020-01-04
      • 1970-01-01
      • 1970-01-01
      • 2011-05-17
      • 2021-01-31
      • 2011-05-07
      • 2015-12-20
      • 1970-01-01
      相关资源
      最近更新 更多