In my Android Studio project, in app/build.gradle, I’m using some values coming from the gradle.properties file in my local .gradle directory. I have used this setup since I do not want to commit these values to the repo.
How can I access these values when using GitLab CI?
I tried adding the values to Settings > CI / CD > Variables but the build.gradle does not seem to see those variables. Build always fails with the error “Could not get unknown property.”
This is how I used properties in my app/build.gradle:
This is how I have set the variables in GitLab CI/CD settings:
This is what I get when running GitLab CI/CD:
I’m following this https://about.gitlab.com/blog/2018/10/24/setting-up-gitlab-ci-for-android-projects/ post to setup my pipeline. The .gitlab-ci.yml script in this post is used without any changes in my project.