12

Trying to inspect my pure Compose app in the layout inspector shows the screen without any layout node information. No errors in the logs. This happens on both real devices and emulators. I have tried Android Studio Bumblebee (latest patch) and Chipmunk (Beta). Compose version is 1.1.1

Layout inspector

bompf
  • 1,374
  • 1
  • 18
  • 24
  • I run into this issue often, where sometimes the layout inspector works with compose but then it stops working. For some reason I am able to get it back to working by enabling "Disable adb authorization timeout", revoking usb debugging authorization and toggling usb debugging. – Luis May 25 '22 at 01:10
  • I also found out that if you select a compose view on the inspector preview, it will show the compose tree even though it originally did not show the compose nodes. – Luis Sep 16 '22 at 19:34

1 Answers1

12

When only the views are shown, but no Composables, make sure to not exclude .version files from META-INF, since the compose UI tooling utilizes them, e.g. remove/adjust these:

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

or

packagingOptions {
    resources {
        excludes += "META-INF/**"
    }
}
dipdipdip
  • 2,326
  • 1
  • 21
  • 31
  • Android Studio - Flamingo, Add "excludes += "META-INF/**", Layout inspctor also not show compose and tip "Compose inspection unavailable. Could not determine the version of the androidx.compose.ui:ui artifact. Was the version file excluded?" – LuoBo May 10 '23 at 02:01