Coder Social home page Coder Social logo

1.2.3上打包,子module依赖support v4,最终打出的包把support包的attr定义打入了。运行时报错 about fat-aar-android HOT 4 CLOSED

TsmileAssassin avatar TsmileAssassin commented on May 28, 2024
1.2.3上打包,子module依赖support v4,最终打出的包把support包的attr定义打入了。运行时报错

from fat-aar-android.

Comments (4)

kezong avatar kezong commented on May 28, 2024

该问题是由于library和application引用的support包版本不一致导致。
你可以选择在library中对support包采用compileOnly的依赖方式解决该问题,或者采用相同的版本。

from fat-aar-android.

charles-yinyu avatar charles-yinyu commented on May 28, 2024

如果是自己的工程代码,可以采用compileOnly的方式,但大量的第三方库,与主工程的support版本不一致,老版本的id或者attr会随着第三方AAR带入到主library的R.txt文件中,导致运行时找不到资源id。
非fataar情况下,系统打apk包时不管资源是否存在,都会给不存在的id分配值,只是不会用到,所以不会出问题

from fat-aar-android.

kezong avatar kezong commented on May 28, 2024

fataar的资源合并方案目前不支持分配了id但不使用的情况,具体原因可以参考源码。

不是所有的library采用都需要采用compileOnly,只需要在使用embed的主library依赖support的时候采用compileOnly就行,如果主library没有直接使用到support,甚至可以不依赖support包。

现在只对library做了R.txt检测,未来会考虑做资源检测,如果资源不存在就不会生成该id,这一块比较复杂,目前仍然规划中,在后期的版本会加上。

from fat-aar-android.

TsmileAssassin avatar TsmileAssassin commented on May 28, 2024

我在主library将support包的implemention 改成compileOnly,没有问题了,这样可以解决。
我看了下dependency,我之前确实只有一个公共的子module依赖support包。

from fat-aar-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.