kezong / fat-aar-android

A gradle plugin that merge dependencies into the final aar file works with AGP 3.+
MIT License
3.08k stars 607 forks source link

Cannot add task 'explodeAndroidx.fragmentFragmentDebug' as a task with that name already exists. #398

Open SagarShedge25 opened 1 year ago

SagarShedge25 commented 1 year ago

Describe the issue I am, trying to build an aar lib but facing below issue, Does anybody has faced similar issue or help me if you aware about it. Thanks

Build Environment

clement-hardouin-idnow commented 1 year ago

I encountered the same issue with transitive option enabled. See #204

TsClown commented 1 year ago

我的依赖里面用了DataBinding导致lifecycle冲突,类似的androidX的包冲突了,排查同一个模块下带有androidX依赖的其他包,然后去掉这些依赖。这个模块的aar就能打成功了。

dependencies {
    implementation("androidx.databinding:databinding-adapters:7.1.2")
    implementation("androidx.databinding:databinding-ktx:7.1.2"){
        exclude(group: 'org.jetbrains.kotlin')
        exclude(group: 'androidx.lifecycle')
    }
    implementation("androidx.databinding:databinding-runtime:7.1.2") {
        exclude(group: 'androidx.lifecycle')
    }
    embed("androidx.appcompat:appcompat:${versions.appcompat}")
}

如果使用DataBinding的话,没法使用以下的方法,只能单独添加依赖,如上代码

buildFeatures{
      dataBinding true
}
GirlFriendNotFind commented 11 months ago

我也遇到这个错误,请问找到解决办法了吗? image