dependency-analysis-gradle-plugin icon indicating copy to clipboard operation
dependency-analysis-gradle-plugin copied to clipboard

Dependencies used in Android Manifest are not recognized

Open Vichy97 opened this issue 2 years ago • 4 comments
trafficstars

Plugin version 1.26.0

Describe the bug I have a theme used in an Android Manifest file that is provided by another module fixDependencies will strip this dependency as unused. android:theme="@style/Theme.MyTheme" In this example, MyTheme is provided by another module and is stripped. It's unclear if it is just not recognizing xml resources or if it isn't checking Android Manifest files specifically.

Expected behavior Modules that provide xml resources that are then used in AndroidManifest.xml will not be removed when running fixDependencies

Vichy97 avatar Nov 17 '23 02:11 Vichy97

@Vichy97 DAGP does check the manifest file for resources that might be provided by other modules. It's possible it's missing the theme statement. Could you provide a minimal reproducer?

autonomousapps avatar Nov 17 '23 22:11 autonomousapps

🤔 I'm unable to repro this in a minimal project for some reason. It must be something specific about register. I'll try to repro there and provide a commit SHA.

Vichy97 avatar Nov 19 '23 19:11 Vichy97

@autonomousapps We are hitting the same issue when referencing a theme containing a period character (.) between two Android library modules.

Here is a PR demonstrating the repro of the issue: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/pull/1146

Should I create a new issue stating the actual issue, or is this one good enough?

Also, I tried to check where this issue could be solved but I'm a bit stuck. I've added some details on the draft PR.

SimonMarquis avatar Mar 13 '24 14:03 SimonMarquis

@SimonMarquis no need for a new issue, this is sufficient. And thanks!

autonomousapps avatar Mar 13 '24 16:03 autonomousapps