Search code examples
androidandroid-jetpack-composelayout-inspector

Layout Inspector doesn't work with Jetpack Compose


Layout Inspector doesn't work with Jetpack Compose and the hint is

Compose inspection unavailable. Could not determine the version of the androidx.compose.ui:ui artifact. Was the version file excluded?

Layout Inspection

I have no idea how to fix it


Solution

  • You probably have excluded the version file as the warning says. Version file is contained under META-INF folder. It should be something like META-INF/*.version. If you have something like below try removing it.

    packagingOptions {
            resources {
                excludes += "META-INF/*.version"
                excludes += "META-INF/**"               
            }
        }
    

    Refer to this link for more details.

    Note: If you are using different build variants, remove it from just debug side.