When migrating a project or switching between branches which are and aren't migrated, Android Studio cannot build projects because it cannot find the android.support.design.widget.Snackbar
package. Support/Design packages are removed but the migration table does not list the correct new package for this component.
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
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.
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)
Add
implementation "com.google.android.material:material:1.1.0"
to your app-levelbuild.gradle
.Also, ensure that your project is set up to migrate old packages to Androidx by including this in your
gradle.properties
file:android.useAndroidX=true android.enableJetifier=true
Old build artifact
com.android.support:design
now solves incom.google.android.material:material:1.0.0
for AndroidX build artifact.Import
instead of
if you shifted to androidx and AS couldn't find the package anymore.