-
Notifications
You must be signed in to change notification settings - Fork 597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removing tools:ignore="GradleOverride" #1669
Conversation
I remember we added this to help non-gradle environments so it seems odd that we need to remove it for Bazel. Compose doesn't bring in Accompanist as well, it's the other way around. Accompanist depends on Compose. What exactly are you trying to do that currently isn't possible? Compose has a minSdk of 21 so why do you need to override that? |
Ah yes you are right. Accompanist appears to be reliant on compose. Sorry about that! But that does not change the core nature of the problem we have. The way we use compose in our codebase is via a common utility module. We create ui-compose views in a ui-compose module for the rest of the codebase to consume. That ui-compose module has a direct dependency on accompanist and makes that an exported dependency. The goal is to be able to compile downstream dependent modules and Robolectric tests. The use case is that we are bumping our app's min SDK version to 24. We also have other 3rd party libraries that have their own min SDK version 28. Ordinarily, we would a Robolectric manifest that has tools:overrideLibrary to get around this. But as long as the ManifestMerger in Bazel consumes and respects the tools:ignore="GradleOverride" tag from Accompanist, we will always get an error:
|
@bentrengrove I have updated the diff. There should be no more lints on each of the corresponding modified AndroidManifests. But yes, perhaps there should be an internal ticket since the actual manifest merge action is done by ManifestMerger2. The code blindly adds all xml tags upstream (including the GradleOverrides) which is why our issue exists. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making that change! This looks good to me
This issue is primarily due to Bazel.
When compiling a module, Bazel will bring in libraries and their transitive dependencies. When resolving manifest merger actions, Accompanist is brought in via the compose library.
Per this GH issue (mixpanel/mixpanel-android#298):
"By ignoring the GradleOverrides, it ignores all overrides for the entire project"
Therefore, as long as an app brings in Accompanist, the app will be forced to use API 21 minimum. They cannot use the tools:overrideLibrary to override Accompanist because Accompanist will be brought in transitively.
It also seems wholly unnecessary to have this tag to begin with as well.