Roberto Fernandez Montero
03/14/2025, 3:49 PMandroidComponents {
beforeVariants(selector().withBuildType("release")) { variant ->
if (variant.name.contains("generic")) {
variant.enable = false
}
}
onVariants { variant ->
variant.outputs.forEach { output ->
if (output is VariantOutputImpl) {
if (output.baseName.contains("newline"))
output
.outputFileName
.value("app-${getNewlineDevice().name}-${getEnvironmentEnum()}-${output.baseName}.apk")
else
output
.outputFileName
.value("app-${getEnvironmentEnum()}-${output.baseName}.apk")
}
}
}
}
It maarks androidComponentes with
Suspicious receiver type; this does not apply to the current receiver of type BaseAppModuleExtension. This will apply to a receiver of type Project, found in one of the enclosing lambdas. Make sure it's declared in the right place in the file. Toggle info (⌘F1)
Vampire
03/14/2025, 3:57 PMandroid {
androidComponents {
}
}
which should instead be
android {
}
androidComponents {
}
or if it was the only content of the android block, then
androidComponents {
}
Having it inside the android { ... }
block is just visual clutter if it does not operate on that extension actually.Roberto Fernandez Montero
03/14/2025, 3:58 PMRoberto Fernandez Montero
03/14/2025, 3:59 PM