Jetpack Compose APK has colors off from AVD

59 views Asked by At

So I'm working on the UI for my app as everything else is done, and I can't seem to figure out what's going on with the colors. When I view the app in my AVD, everything is looking as expected. However, when I download the APK, everything is a weird shade of brown instead.

I have both the DarkColorScheme and LightColorScheme set to specific colors, and working as intended in the APK.

Originally I thought it was because I was using the debug APK, but it's the same on the release. I have no idea what's going on. Does anyone have any suggestions?

I'm using Android Studio 2022.2.1 if it helps.

This is how the app should look: how app looks on AVD

This is how it looks running on my device: How the app looks on device

1

There are 1 answers

6
ΓDΛ On BEST ANSWER

As can be seen from the screenshots, DynamicColors are used.

You may consider turning it off on your device.

DynamicColor disabled:

Theme.kt

val colorScheme = when {
        /*dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
            val context = LocalContext.current
            if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
        }*/ // removed condition state

        darkTheme -> DarkColorScheme
        else -> LightColorScheme
    }