Skip to content

Build fails when key.properties is missing (null cast error in build.gradle.kts) #801

@Shweta-281

Description

@Shweta-281

🐛 Describe the bug

🐛 Problem

Running the project using flutter run fails with the following error:
null cannot be cast to non-null type kotlin.String

The issue occurs in android/app/build.gradle.kts when accessing keystore properties like:

keyAlias = keystoreProperties["keyAlias"] as String

If key.properties file is not present (which is expected for new contributors), these values become null and cause a crash.

Expected Behavior:

The project should run successfully without requiring key.properties, especially for debug builds.

Suggested Fix:

- Safely handle null values in keystoreProperties
- OR use debug signing config when key.properties is missing
- Add key.properties.example for contributor guidance

Additional Context:

This issue affects new contributors trying to set up the project locally and creates unnecessary friction.

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