gpt4 book ai didi

android - 不同包中的相同库不起作用

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:00:08 24 4
gpt4 key购买 nike

更新到最新的gradle后,在构建项目时出现奇怪的错误:

[:feature_x, :feature_y] all package the same library  [com.github.PhilJay:MPAndroidChart].

我确实在这两个功能中都添加了这个库。它们被设置为依赖项,例如:

api "com.github.PhilJay:MPAndroidChart:$rootProject.MPAndroidChart"

这是怎么回事?

最佳答案

根据 this issue,截至 2018-10 年,这是预期行为在 Google 的问题跟踪器中:

Yes, multiple non-base features depending on the same library is currently not supported because both of the features will package the library, but there's no guarantee that they'll package the same version of the library, which can lead to crashes at runtime. We opted to fail the build in these cases to prevent unexpected behavior at runtime.

Unfortunately, adding the library as a dependency to the base module is the suggested workaround for this.

关于android - 不同包中的相同库不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52544722/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com