I got this error while Migrating to AndroidX
To resolve I did:
-
as suggested by @Mikeumus – and added this to the module’s build.gradle dependencies:
implementation ‘androidx.coordinatorlayout:coordinatorlayout:latest.version.here’
-
check in the Layout XML file (the layout that you’re trying to launch with setContentView
if the Layout contains:
<android.support.design.widget.CoordinatorLayout
…
replace that with : <androidx.coordinatorlayout.widget.CoordinatorLayout
- in the same layout file – replace the closing tag
</android.support.design.widget.CoordinatorLayout>
with
</androidx.coordinatorlayout.widget.CoordinatorLayout>