flutter com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable

zvokhttg  于 2023-10-22  发布在  Flutter
关注(0)|答案(1)|浏览(231)

我在flutter应用程序中使用了两个包
flutter_jailbreak_detection
flutter_root_jailbreak
对于android都使用相同的原生implementation 'com.scottyab:rootbeer-lib:0.1.0'依赖,所以我不能在android平台上运行应用程序,因为原生包类重复。

Execution failed for task ':app:checkDevDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class com.scottyab.rootbeer.BuildConfig found in modules jetified-rootbeer-0.1.0-runtime (com.github.scottyab:rootbeer:0.1.0) and jetified-rootbeer-lib-0.1.0-runtime (com.scottyab:rootbeer-lib:0.1.0)
     Duplicate class com.scottyab.rootbeer.Const found in modules jetified-rootbeer-0.1.0-runtime (com.github.scottyab:rootbeer:0.1.0) and jetified-rootbeer-lib-0.1.0-runtime (com.scottyab:rootbeer-lib:0.1.0)
     Duplicate class com.scottyab.rootbeer.RootBeer found in modules jetified-rootbeer-0.1.0-runtime (com.github.scottyab:rootbeer:0.1.0) and jetified-rootbeer-lib-0.1.0-runtime (com.scottyab:rootbeer-lib:0.1.0)
     Duplicate class com.scottyab.rootbeer.RootBeerNative found in modules jetified-rootbeer-0.1.0-runtime (com.github.scottyab:rootbeer:0.1.0) and jetified-rootbeer-lib-0.1.0-runtime (com.scottyab:rootbeer-lib:0.1.0)
     Duplicate class com.scottyab.rootbeer.util.QLog found in modules jetified-rootbeer-0.1.0-runtime (com.github.scottyab:rootbeer:0.1.0) and jetified-rootbeer-lib-0.1.0-runtime (com.scottyab:rootbeer-lib:0.1.0)
     Duplicate class com.scottyab.rootbeer.util.Utils found in modules jetified-rootbeer-0.1.0-runtime (com.github.scottyab:rootbeer:0.1.0) and jetified-rootbeer-lib-0.1.0-runtime (com.scottyab:rootbeer-lib:0.1.0)

     Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.

根据文档,我也试图排除/分组相同的软件包在应用程序级构建Gradle文件中使用波纹管代码,但仍然无法运行应用程序。

implementation ('com.example.library:library:1.0') {
        exclude group: 'com.scottyab', module: 'rootbeer'
}
ars1skjm

ars1skjm1#

假设您正在Android项目中使用RootBeer库,请打开android/app/build.gradle文件,并尝试添加以下块以排除冲突类

android {
    ...
    configurations {
        all {
            exclude group: 'com.scottyab', module: 'rootbeer-lib'
        }
    }
}

相关问题