ColorFilter not applying in release mode

30 views Asked by At

When I installed the app via USB, it works fine and color filter is applied as intended but when I try to generate a signed apk, and install the same - color filter doesn't apply. enter image description here

/**
 * Represents a square on the Tic Tac Toe game board.
 * @param markImg The image resource ID for the mark (X or O) to be displayed in the square.
 * @param onSquareClick A function to be invoked when the square is clicked.
 * @param modifier The modifier to be applied to the square.
 */
@Composable
fun Square(

    @DrawableRes markImg: Int?,

    onSquareClick: () -> Unit,

    modifier: Modifier = Modifier

) {

    Surface(

        modifier = Modifier

            .size(dimensionResource(id = R.dimen.card_size_lg))

            .padding(dimensionResource(id = R.dimen.padding_medium)),

        shadowElevation = dimensionResource(id = R.dimen.card_elevation),

        shape = RoundedCornerShape(16.dp)

    ) {

        Column(

            modifier = modifier

                .fillMaxSize()

                .clickable { onSquareClick() },

            verticalArrangement = Arrangement.Center,

            horizontalAlignment = Alignment.CenterHorizontally

        ) {

            markImg?.let {

                Image(

                    painter = painterResource(id = markImg),

                    contentDescription = null,

                    modifier = modifier

                        .padding(dimensionResource(id = R.dimen.padding_large)),

                    colorFilter = ColorFilter.tint(color = MaterialTheme.colorScheme.onBackground)

                )

            }

        }

    }

}

I refactored my code to simplify the state of tic tac toe game - https://github.com/aqib-m31/Tic-Tac-Toe-App I generated an apk file but playstore shows app not installed, when I filled Play Protect appeal form, release apk file gets installed but it doesn't show the correct colors. I ain't able to figure out why this happens.

0

There are 0 answers