Comments (4)
该问题是由于library和application引用的support包版本不一致导致。
你可以选择在library中对support包采用compileOnly
的依赖方式解决该问题,或者采用相同的版本。
from fat-aar-android.
如果是自己的工程代码,可以采用compileOnly的方式,但大量的第三方库,与主工程的support版本不一致,老版本的id或者attr会随着第三方AAR带入到主library的R.txt文件中,导致运行时找不到资源id。
非fataar情况下,系统打apk包时不管资源是否存在,都会给不存在的id分配值,只是不会用到,所以不会出问题
from fat-aar-android.
fataar的资源合并方案目前不支持分配了id但不使用的情况,具体原因可以参考源码。
不是所有的library采用都需要采用compileOnly
,只需要在使用embed的主library依赖support的时候采用compileOnly
就行,如果主library没有直接使用到support,甚至可以不依赖support包。
现在只对library做了R.txt检测,未来会考虑做资源检测,如果资源不存在就不会生成该id,这一块比较复杂,目前仍然规划中,在后期的版本会加上。
from fat-aar-android.
我在主library将support包的implemention 改成compileOnly,没有问题了,这样可以解决。
我看了下dependency,我之前确实只有一个公共的子module依赖support包。
from fat-aar-android.
Related Issues (20)
- 1.3.8的fat-aar版本,AGP 7.3 Gradle7.4,资源文件没merge到一起,class什么的都merge到一起了。 HOT 11
- Duplicated *.so resources HOT 5
- packagingOptions的配置对这个插件生效吗
- resources not included on AGP 7.3.0 HOT 2
- Build fat AAR file from flutter module
- Binding Resouces (.BR) not created for sub lib,
- java.lang.NoSuchFieldError: No static field ic_rapido_splash of type I in class Lcom/rapido/passenger/R$drawable; or its superclasses
- Could not resolve all dependencies for configuration ':dsrrdlibrary:embed HOT 1
- Android Resource linking failed
- Support for Gradle 8+, AGP 8+ HOT 3
- 如何过滤abi,打出来的最终AAR包含了x86,armeabi,armeabi-v7a,arm64-v8a所有的so,不想要这么多,abiFilters不生效
- Failed to apply plugin [id 'com.kezong.fat-aar'] HOT 2
- java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/lifecycle/runtime/R$id; HOT 1
- 完全不生效
- Task with name 'transformClassesWithTransformRForFataarDebug' not found in project HOT 2
- 一种安全的替换 fat-aar-android 插件的方法 HOT 8
- Is there a package relocation for the embed dependencies?
- 请问下如何配置Gradle 8.0版本 HOT 1
- How to exlcude "org.jetbrains.kotlin:kotlin-stdlib" HOT 2
- Cannot Merge SmartRefreshLayout 打包Module无法合并SmartRefreshLayout
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fat-aar-android.