0

I am creating an android app in java and locally, all the tests pass and everything builds succesfully. However, once I push the code to gitHub that uses cirrus for CI, I get the following issue:

chmod +x gradlew ./gradlew assembleDebugAndroidTest Downloading https://services.gradle.org/distributions/gradle-7.5-bin.zip ...........10%............20%...........30%............40%...........50%............60%...........70%............80%...........90%............100% Welcome to Gradle 7.5!

Here are the highlights of this release: Support for Java 18 Support for building with Groovy 4 Much more responsive continuous builds Improved diagnostics for dependency resolution

For more details see https://docs.gradle.org/7.5/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster) Configuration on demand is an incubating feature.

FAILURE: Build failed with an exception.

What went wrong: A problem occurred configuring project ':app'. Failed to notify project evaluation listener. The file '/tmp/cirrus-ci-build/local.properties' could not be found

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 35s

I recently started to use the Google Maps API and I am not sure if the modifications that I did in the gradle files for that purpose introduced issues.

This is what my project build.gradle contains:

buildscript {
    repositories {
        google()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:7.4.2'
    }
}
plugins {
    id 'com.android.application' version '7.4.1' apply false
    id 'com.android.library' version '7.4.1' apply false
    id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' version '2.0.1' apply false
}

The following is in my settings.gradle:

pluginManagement {
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
}
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
    }
}
rootProject.name = "CoachMe"
include ':app'

ext.isCiServer = System.getenv().containsKey("CIRRUS_CI")
ext.isMasterBranch = System.getenv()["CIRRUS_BRANCH"] == "main"
ext.buildCacheHost = System.getenv().getOrDefault("CIRRUS_HTTP_CACHE_HOST", "localhost:12321")

buildCache {
    local {
        enabled = !isCiServer
    }
    remote(HttpBuildCache) {
        url = "http://${buildCacheHost}/"
        enabled = isCiServer
        push = isMasterBranch
    }
}

I saw the post Android Studio - Failed to notify project evaluation listener error but the suggestions did not help for me. Does anyone have an idea where the issue could come from?

UPDATE: I could resolve the issue by updating my .cirrus.yml file accordingly. I had to insert echo MAPS_API_KEY=$MAPS_API_KEY >> local.properties in the assemble_instrumented_tests_script. Also, I added the maps_api_key in the env section as MAPS_API_KEY: ENCRYPTED[...].

0 Answers0