kezong / fat-aar-android

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

Double classes.jar #248

Open george-vlahakis opened 3 years ago

george-vlahakis commented 3 years ago

After building the fat-aar and inspecting it's contents it turns out that the aar contains two classes.jar files, one in the other. I do not think this is normal and it causes problems trying to access classes from the 2nd-level classes.jar file.

102581632-a1344300-4109-11eb-86f5-0baf8e75441f

kezong commented 3 years ago

I think this classes.jar which is in another jar file, so it's merged.

george-vlahakis commented 3 years ago

No it's another module in the project. We have 4 modules in the project, each producting an aar, and the last we need to combine all in one fat-aar. The classes in the classes.jar is from the 2nd module.

kezong commented 3 years ago

Can you provide a simple demo? I can't repro it locally. Thank you.

perqin commented 3 years ago

I'm encountering this issue too. The inner classes.jar (so as the sibling AndroidManifest.xml, etc.) is from an aar library file. That is:

I've created a demo project and found that it is AGP's fault. Using AGP 3.5.0, the module2 above can be built, producing the strange aar file. If upgrading AGP to 4.+, AGP will compain that it is not allowed for a library module to depend on an aar file.