Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,8 @@ class FlavorArtifact {
}
}

if (variant.productFlavors.isEmpty()) {
return false
}
// 2. find missingStrategies
ProductFlavor flavor = variant.productFlavors.first()
ProductFlavor flavor = variant.productFlavors.isEmpty() ? variant.mergedFlavor : variant.productFlavors.first()
flavor.missingDimensionStrategies.find { entry ->
String toDimension = entry.getKey()
String toFlavor = entry.getValue().getFallbacks().first()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kezong should't we first try the requested value and then try all the fallbacks?

Suggested change
String toFlavor = entry.getValue().getFallbacks().first()
String toFlavor = entry.getValue().requested

Because the semantic of missingDimensionStrategy is as follows:
missingDimensionStrategy 'dimension', 'requested', 'fallback1', 'fallback2' ...

getFallbacks().first() would select fallback1 and skipping requested and ignoring the other fallbacks.

As a result missingDimensionStrategy 'dimension', 'requested' causes an exception, because it has not fallbacks.

Expand Down