-
Notifications
You must be signed in to change notification settings - Fork 51
Apply configuration new variants API only when Plugins are present #414
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
Conversation
I looked also and noticed we apply the plugin using this in our root
The error probably happen because we apply it regardless it's a project with or without android plugin. We should probably fix our build script too, thanks for looking quickly at the issue! |
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.
let's add a test for this as well.
@runningcode added unit tests covering plugin block configuration with/wo applying the plugin by default |
configureNewVariants(project, configureVariants) | ||
} | ||
|
||
project.plugins.withId("com.android.library") { |
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.
It's already merged, but shouldn't the plugin also apply to modules that use com.android.test plugin?
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.
I think it should also apply to modules with com.android.dynamic-feature
plugin.
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.
@daio @eboudrant you're right.
Checking the hierarchy of the plugins:
I'm wondering if checking by com.android.base
would be enough. Next week will work on this
Issue #412 describes the issue when using AGP 7.4 and the Plugin throws:
This is caused when the plugin is configuring a project without Android plugins applied.
I can reproduce the error when in the project
nowinandroid
I remove theapply false
in the plugin definition. That means the rootProject is trying to retrieve theandroidComponents
:when they are not applied. This is a change in the AGP not reproducible in 7.3.1.
Similar to the old implementation this PR only applies the configuration when a project contains the Android plugins.