Error when using any Android Design Support Library Elements -
error inflating design support library
xml
<android.support.design.widget.floatingactionbutton android:layout_width="wrap_content" android:layout_height="wrap_content"/> build.gradle
dependencies { compile 'com.android.support:support-v4:22.2.0' compile 'com.android.support:design:22.2.0' compile 'com.android.support:multidex:1.0.1' compile 'com.android.support:support-v13:22.2.0' compile 'com.android.support:appcompat-v7:22.2.0' project build.gradle
buildscript { repositories { mavencentral() } dependencies { classpath 'com.android.tools.build:gradle:1.2.3' } } allprojects { repositories { mavencentral() } } error:
binary xml file line #115: error inflating class android.support.design.widget.floatingactionbutton my sdk manager date. 
in addition emmanuel's answer facing following problem.
it seems design library components need style based on appcompat theme. try use "theme.appcompat.[...]" parent in style.xml.
example:
<!-- base application theme. --> <style name="apptheme" parent="base.apptheme"> <!-- customize theme here. --> </style> <style name="base.apptheme" parent="theme.appcompat.light.darkactionbar"> <item name="android:colorprimary">@color/primary</item> <item name="android:colorprimarydark">@color/primary_dark</item> <item name="android:coloraccent">@color/accent</item> </style> then add following build.gradle well:
compile 'com.android.support:appcompat-v7:22.2.0' additionally should update following lines in gradle well:
classpath 'com.android.tools.build:gradle:1.2.3' compilesdkversion 22 buildtoolsversion '22.0.1' targetsdkversion 22
Comments
Post a Comment