Skip to content

Building for Desktop on GNU/Linux fails with Define a valid SDK location with an ANDROID_HOME environment variable or Declaring 'crunchPngs' as a property [...] on com.android.build.gradle.internal.dsl.BuildType$AgpDecorated has been deprecated.. #9

Description

@dreirund

Ahoj,

I am trying to build the desktop app from the latest git checkout from this repository on Artix GNU/Linux (rolling release).

  • When I build with system installed gradle version 9.5.1 an Java version OpenJDK 26.0.1 (using gradle instead of ./gradlew), building :app fails with
> Configure project :app
Evaluating project ':app' using build file '/var/cache/makepkg/build/bruce-app-git/src/bruce-app/app/build.gradle.kts'.
Resolved plugin [id: 'com.android.application']
Resolved plugin [id: 'org.jetbrains.kotlin.android']
Using default execution profile
Using Kotlin Gradle Plugin gradle71 variant
Could not execute [class org.jetbrains.kotlin.gradle.plugin.statistics.KotlinBuildStatHandler.buildFinished]

[Incubating] Problems report is available at: file:///var/cache/makepkg/build/bruce-app-git/src/bruce-app/build/reports/problems/problems-report.html

FAILURE: Build failed with an exception.

, and the file /var/cache/makepkg/build/bruce-app-git/src/bruce-app/build/reports/problems/problems-report.html mentions

- [warn]  Declaring 'crunchPngs' as a property using an 'is-' method with a Boolean type on com.android.build.gradle.internal.dsl.BuildType$AgpDecorated has been deprecated. (1)

        - [warn]  Declaring 'crunchPngs' as a property using an 'is-' method with a Boolean type on com.android.build.gradle.internal.dsl.BuildType$AgpDecorated has been deprecated.
        Declaring 'crunchPngs' as a property using an 'is-' method with a Boolean type on com.android.build.gradle.internal.dsl.BuildType$AgpDecorated has been deprecated.

        Starting with Gradle 10, this property will no longer be treated like a property.

                - Locations
            [enum]  Plugin`com.android.internal.application`
                - Solutions
            [enum]  Add a method named 'getCrunchPngs' with the same behavior and mark the old one with @Deprecated, or change the type of 'com.android.build.gradle.internal.dsl.BuildType$AgpDecorated.isCrunchPngs' (and the setter) to 'boolean'.
            [enum]  The combination of method name and return type is not consistent with Java Bean property rules.

- [warn]  Declaring 'useProguard' as a property using an 'is-' method with a Boolean type on com.android.build.gradle.internal.dsl.BuildType has been deprecated. (1)

        - [warn]  Declaring 'useProguard' as a property using an 'is-' method with a Boolean type on com.android.build.gradle.internal.dsl.BuildType has been deprecated.
        Declaring 'useProguard' as a property using an 'is-' method with a Boolean type on com.android.build.gradle.internal.dsl.BuildType has been deprecated.

        Starting with Gradle 10, this property will no longer be treated like a property.

                - Locations
            [enum]  Plugin`com.android.internal.application`
                - Solutions
            [enum]  Add a method named 'getUseProguard' with the same behavior and mark the old one with @Deprecated, or change the type of 'com.android.build.gradle.internal.dsl.BuildType.isUseProguard' (and the setter) to 'boolean'.
            [enum]  The combination of method name and return type is not consistent with Java Bean property rules.

- [warn]  Declaring dependencies using multi-string notation has been deprecated. (2)

        - [warn]  Declaring dependencies using multi-string notation has been deprecated.
        Declaring dependencies using multi-string notation has been deprecated.

        This will fail with an error in Gradle 10.

                - Locations
            [enum]  Plugin`com.android.internal.application`
                - Solutions
            [enum]  Please use single-string notation instead: "com.android.tools.lint:lint-gradle:31.6.1".
        - [warn]  Declaring dependencies using multi-string notation has been deprecated.
        Declaring dependencies using multi-string notation has been deprecated.

        This will fail with an error in Gradle 10.

                - Locations
            [enum]  Plugin`com.android.internal.application`
                - Solutions
            [enum]  Please use single-string notation instead: "com.android.tools.build:aapt2:8.6.1-11315950:linux".

Image
  • When using ./gradlew clean build, it fails with
FAILURE: Build failed with an exception.

* What went wrong:
26.0.1
  • When I additionally manually install old version of Java JDK, jdk21-openjdk version 21.0.11.u10, and make that my default Java, then it fails with
FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> SDK location not found. Define a valid SDK location with an ANDROID_HOME environment variable or by setting the sdk.dir path in your project's local properties file at '/var/cache/makepkg/build/bruce-app-git/src/bruce-app/local.properties'.

More verbose build log (executing ./gradlew -PreleaseBuild=true --no-daemon -console verbose --info --no-parallel clean build and capturing the terminal output -- note that the error just reported above also happens without all those command line options, also without -PreleaseBuild=true):

gradle-build.log


Seems that, contrary to what the README.md says, it cannot be built for on non-Android desktop.

Regards!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions