I am developing an app which have Tab with swipe functionality. I am using Eclipse to develop. I have imported the support design library as Library through Pro
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
</android.support.design.widget.CoordinatorLayout>
with
</androidx.coordinatorlayout.widget.CoordinatorLayout>
For me, this error was resulting from using some androidx libraries but then still having the old coordinate layout in some layout.xml files.
build.gradle:
com.android.support:coordinatorlayout -> androidx.coordinatorlayout:coordinatorlayout:1.0.0-alpha1
If you're using androidx then maybe this is your problem too.
I had to update the other v7 libraries like Toolbar as well.
See the androidx migration guide here: https://developer.android.com/topic/libraries/support-library/refactor
For android studio try to add these dependencies
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
I found the solution for eclipse
Problem what i faced is R.Java file is not generated under support.design in gen/ folder.
After doing the below steps R.Java file is generated. Main issue is design library is target to 22. Changing to 23 worked.
Import support design library from \sdk\extras\android\support\design to eclipse workspace.
Open project.properties of AppCompat and design Library and target it to 23
Clean Appcompat, design and YourProject.
Run the app
Make sure that in your activity set theme AppCompat
<activity
android:name=".newApp.screens.main.MainActivity"
android:label="@string/title_activity_main_launch"
android:theme="@style/AppThemes"></activity>
<!-- Base application theme. -->
<style name="AppThemes" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">#673AB7</item>
<item name="colorPrimaryDark">#512DA8</item>
<item name="colorAccent">#00BCD4</item>
</style>