why does `animateColorAsState` break my `@Preview` in Flamingo?
c
why does
animateColorAsState
break my
@Preview
in Flamingo?
Also doesn't work in Dolphin or Eel
Could not get applicationId for my.module.main. Project type: PROJECT_TYPE_LIBRARY
that was reported... if I add
applicationId
into the default config of my library... the preview starts working again
j
You need to set applicationId only n module:app, the others library module, does not set applicationId. Its not about IDE version
c
if I don't add this, the preview will not render. Are previews only supported in application modules?
j
your project must have at least one applicationId, thats correct. @Preview are supported in any module (app or library), check your definitions
c
so just to be really clear: Using
animateColorAsState
in a
@Preview
in an android library module resulted in no previews rendering. Changing the use of animateColorAsState to a static colour resulted in all the previews rendering correctly. Upon replacing the static colour with
animateColorAsState
again, Android Studio notified me of the following exception:
Could not get applicationId for my.module.main. Project type: PROJECT_TYPE_LIBRARY
As a way of checking whether it was possible to placate the error, I placed
applicationId 'my.module'
in my build.gradle for my android library module, which resulted in the preview rendering successfully, with the AGP giving a warning that
applicationId
should not be in a library module. Things I know:
applicationId
shouldn't be in the build.gradle for a library module Things I don't know: Why the preview using
animateColorAsState
won't render unless I place
applicationId
in my build.gradle
e
Probably a bug. Have you checked issuetracker to see if a report already exists? If one doesn't, please consider filing one.