Can't Access Version Name from gradle file

bitrise-tools
workflow
workflow-editor
bitriseio
android
#1

I want read version name from app/gradle in android . Unfortunately I am getting null value. I have used the below script. Correct me if I am wrong. Thanks !

#!/usr/bin/env bash

set -e

POR="$(cat app/build.gradle | grep -o “versionName\s+[*]+” | awk ‘{ print $2 }’)"
envman add --key CURRENT_VERSION_NAME --value “$POR”
envman add --key=MY_TIMESTAMP --value="$(date +"%y%m%d")"

0 Likes

#2

Hi @ptm4dev! Can you share the entire build log where you run this script? :slight_smile: Also keep in mind that we have a steps to print out and to change your versionName and versionCode if that’s what you’re looking for!

0 Likes

closed #3

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

0 Likes