android – Snackbar package in AndroidX-ThrowExceptions

Exception or error:

When migrating a project or switching between branches which are and aren’t migrated, Android Studio cannot build projects because it cannot find the package. Support/Design packages are removed but the migration table does not list the correct new package for this component.

How to solve:

This took a long time to resolve, as until your project successfully builds, autocomplete will not function to lookup packages.

The correct package to use is:

It is also important to remember to change this on the XML tags as well as the imports if the migration has not worked successfully.


Old build artifact now solves in for AndroidX build artifact.


Add implementation "" to your app-level build.gradle.

Also, ensure that your project is set up to migrate old packages to Androidx by including this in your file:




instead of;

if you shifted to androidx and AS couldn’t find the package anymore.


Updating to Anko version 0.10.8 will resolve this, it will tell you that snackbar(view, int) is now deprecated, instead of it you will use view.snackbar(int: Message)

Leave a Reply

Your email address will not be published. Required fields are marked *