material design - CoordinatorLayout not working in Android Studio 2.1.2? -
my android studio unable find coordinatorlayout
class.
screenshot :
it says:
the following classes not found: -android.support.design.widget.coordinatorlayout.
this xml code:
<?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.coordinatorlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context="com.musical_box.musicbox.mainactivity"> <framelayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/player_control_container"> </framelayout> </android.support.design.widget.coordinatorlayout>
i know question has been asked lot of times have tried of solutions, , none worked me. 1 thing noticed android studio not suggesting coordinatorlayout
while writing code. guessing there missing libraries. here code gradle build:
apply plugin: 'com.android.application' android { compilesdkversion 24 buildtoolsversion "24.0.0" defaultconfig { applicationid "com.musical_box.musicbox" minsdkversion 15 targetsdkversion 24 versioncode 1 versionname "1.0" } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile filetree(dir: 'libs', include: ['*.jar']) testcompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:24.0.0' compile 'com.android.support:support-v4:24.0.0' }
i have build tools 24.0.0 installed on system. can unable figure out problem , new android dev.
appreciated.
add
compile 'com.android.support:design:24.1.1'
to gradle file. should work. part of design library. need add 1 access coordinatorlayout
.
Comments
Post a Comment