Skip to content

Failing to resolve projectEnv.get() in build.gradle when detecting Android version #27

Description

@helbery-chefaa

Description:

After updating from 0.0.11 to 0.0.12, release-react fails with:

No property named "projectEnv.get(ANDROID_VERSION_NAME)" exists in the following files: android/app/gradle.properties, android/gradle.properties.

CLI is installed via the GitHub Action:

  • name: Setup Revopush CLI
    uses: 'revopush/revopush-github-action@v1'
    id: setup-revopush-cli
    with:
    version: 'latest'

Using version: 'latest' started pulling 0.0.12, which introduced this regression.

Our build.gradle uses react-native-config's project.env to load the version:

def projectEnv = project.env
// ...
versionName projectEnv.get("ANDROID_VERSION_NAME")

The CLI parses build.gradle, finds projectEnv.get("ANDROID_VERSION_NAME"), and then looks for ANDROID_VERSION_NAME as a property in gradle.properties — but it's defined in .env
and loaded via react-native-config's dotenv.gradle. This worked correctly in 0.0.11.

The --targetBinaryVersion flag is also provided explicitly, so auto-detection should either handle this pattern or be skippable.

Workaround: Pin the CLI to 0.0.11:

with:
version: '0.0.11'

Expected behavior: The CLI should either:

  1. Correctly resolve projectEnv.get(...) by reading .env (via react-native-config)
  2. Skip auto-detection when --targetBinaryVersion is explicitly provided
  3. Fall back gracefully instead of erroring

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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