android - FloatingActionButton Unable to start activity ComponentInfo -
i want use floating action button in application ,to got latest support library 22.2.1 , add application library. cleaned project , there no more errors . put code in xml layout , when run application ,i ran error couldn't solve .
this xml code :
<?xml version="1.0" encoding="utf-8"?> <scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:padding="4dp" > <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" > <android.support.design.widget.floatingactionbutton android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom" android:layout_margin="16dp" android:clickable="true" android:src="@drawable/ic_action_person" /> </linearlayout> </scrollview>
this no whole code ,i've other views in linearlayout , @ end put floatingactionbutton.
when run application ,i error :
fatal exception: main java.lang.runtimeexception: unable start activity componentinfo{com.karaj.project/com.karaj.project.fistactiivty}: android.view.inflateexception: binary xml file line #301: error inflating class android.support.design.widget.floatingactionbutton @ android.app.activitythread.performlaunchactivity(activitythread.java:2211) @ android.app.activitythread.handlelaunchactivity(activitythread.java:2261) @ android.app.activitythread.access$600(activitythread.java:141) @ android.app.activitythread$h.handlemessage(activitythread.java:1256) @ android.os.handler.dispatchmessage(handler.java:99) @ android.os.looper.loop(looper.java:137) @ android.app.activitythread.main(activitythread.java:5103) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:525) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:737) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:553) @ dalvik.system.nativestart.main(native method) caused by: android.view.inflateexception: binary xml file line #301: error inflating class android.support.design.widget.floatingactionbutton @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:707) @ android.view.layoutinflater.rinflate(layoutinflater.java:755) @ android.view.layoutinflater.rinflate(layoutinflater.java:758) @ android.view.layoutinflater.inflate(layoutinflater.java:492) @ android.view.layoutinflater.inflate(layoutinflater.java:397) @ com.karaj.project.draweractivity.setcontentview(draweractivity.java:73) @ com.karaj.project.fistactiivty.oncreate(fistactiivty.java:88) @ android.app.activity.performcreate(activity.java:5133) @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1087) @ android.app.activitythread.performlaunchactivity(activitythread.java:2175) ... 11 more caused by: java.lang.classnotfoundexception: didn't find class "android.support.design.widget.floatingactionbutton" on path: dexpathlist[[zip file "/data/app/com.karaj.persiandesigners-1.apk"],nativelibrarydirectories=[/data/app-lib/com.karaj.persiandesigners-1, /system/lib]] @ dalvik.system.basedexclassloader.findclass(basedexclassloader.java:53) @ java.lang.classloader.loadclass(classloader.java:501) @ java.lang.classloader.loadclass(classloader.java:461) @ android.view.layoutinflater.createview(layoutinflater.java:559) @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:696) ... 20 more
what doing wrong ?
do not add support library jar file project add line gradle file
compile 'com.android.support:design:22.2.1'
and update android support "repository"
http://android-developers.blogspot.com/2015/05/android-design-support-library.html
Comments
Post a Comment