Hello people!
edit : added ref to project for bitrise folks: https://app.bitrise.io/build/48ff6b7c8b9170cb
I have Android Lint and Build steps configured the same way:
- ProjectLocation: tools/some-android-project
- APKPathPattern:
- AppPathPattern: */build/outputs/apk/*.apk
*/build/outputs/bundle/*.aab
- Variant: debug
- Module: app:collector
- BuildType: apk
- Arguments:
- CacheLevel: only_deps
- DeployDir: /bitrise/deploy
This is printed by both the lint and build steps. Linter works fine, build step fails
Variants:
Failed to find buildable variants, error: module not found: app:collector
Looking at the source code, I see:
if err != nil {
return fmt.Errorf("Failed to open project, error: %s", err)
}
lintTask := gradleProject.
GetTask("lint")
log.Infof("Variants:")
fmt.Println()
variants, err := lintTask.GetVariants()
if err != nil {
return fmt.Errorf("Failed to fetch variants, error: %s", err)
}
filteredVariants, err := filterVariants(config.Module, config.Variant, variants)
if err != nil {
failf("Failed to find buildable variants, error: %s", err)
}
for module, variants := range variants {
and
var buildTask *gradle.Task
if config.BuildType == "apk" {
buildTask = gradleProject.GetTask("assemble")
} else {
buildTask = gradleProject.GetTask("bundle")
}
log.Infof("Variants:")
fmt.Println()
variants, err := buildTask.GetVariants()
if err != nil {
return fmt.Errorf("Failed to fetch variants, error: %s", err)
}
filteredVariants, err := filterVariants(config.Module, config.Variant, variants)
if err != nil {
return fmt.Errorf("Failed to find buildable variants, error: %s", err)
}
for module, variants := range variants {
Esentially the same, they use the same mechanics to determine appropriate task to execute for the appropriate task.
I double checked locally after a git clean -fdx
that I have assemble and lint tasks for the module as well. An excerpt from the output:
> gradlew tasks --all
app:collector:lint
app:collector:lintDebug
app:collector:assembleDebug
I’m confused. Why do I get the error on assemble task but not on lint? What do I do to work around this issue?
koral
January 27, 2020, 4:27pm
2
You can use Gradle Build step as a workaround.
Yeah, well… As a workaround it might work (couldn’t get it to work yet). Will keep trying, though I’m not a big fan of workarounds. I started off with the Android build project template and it kind of hurts my OCD that I need to use different steps than what was provided for me by default.
In general, where do people usually report bugs?
Hi @juliusk9 ! Are you still looking for assistance with this or were you able to figure it out? Thanks