Skip to content

[possibly not a bug] app/build.gradle: oddly explicit sdkmanager path results in gradle build error #74

@robertkirkman

Description

@robertkirkman

Hello, I am not sure whether this project is intended to support local recompilation of the APK or not, if that is not intended and only the released APKs are supported, then this can be ignored.

When I used

./gradlew assembleDebug

This happened,

> Task :app:ensure-sources FAILED

> Task :app:gen-proto-keycodes
KeyCode enum up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:ensure-sources'.
> A problem occurred starting process 'command '/mnt/Storage/Files/Application_Files/android-sdk/cmdline-tools/latest/bin/sdkmanager''

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 3s
32 actionable tasks: 32 executed
Configuration cache entry stored.

It seemed related to this block of code, because when I locally deleted this block and tried again, the error disappeared and the build was successful.

if (System.getenv("GITHUB_ACTIONS") == null) {
tasks.register("gen-proto-keycodes") {
actions.push(new UpdateProtoAction(projectDir.path, android.sdkDirectory.path, android.compileSdk.toString()))
}
tasks.register("ensure-sources", Exec.class) {
it.commandLine(Paths.get(android.sdkDirectory.path, "cmdline-tools", "latest", "bin", "sdkmanager").toString(), "sources;android-" + android.compileSdk.toString())
}
tasks.preBuild {
dependsOn("gen-proto-keycodes", "ensure-sources")
}
}

Do you know what this block is specifically for, and would it be OK to disable it by default for local builds?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions