android - Appcompat Activity Giving issues for version 24.0.0 -
i want work coordinator layout , gradle file includes following dependencies,
compile 'com.android.support:appcompat-v7:24.0.1' compile 'com.android.support:design:24.0.1'
but gives me following error,
exception while inflating <vector> org.xmlpull.v1.xmlpullparserexception: binary xml file line #17<vector> tag requires viewportwidth > 0 @ android.support.graphics.drawable.vectordrawablecompat.updatestatefromtypedarray(vectordrawablecompat.java:541) @ android.support.graphics.drawable.vectordrawablecompat.inflate(vectordrawablecompat.java:478) @ android.support.graphics.drawable.vectordrawablecompat.createfromxmlinner(vectordrawablecompat.java:441) @ android.support.v7.widget.appcompatdrawablemanager$vdcinflatedelegate.createfromxmlinner(appcompatdrawablemanager.java:736) @ android.support.v7.widget.appcompatdrawablemanager.loaddrawablefromdelegates(appcompatdrawablemanager.java:359) @ android.support.v7.widget.appcompatdrawablemanager.getdrawable(appcompatdrawablemanager.java:189) @ android.support.v7.widget.appcompatdrawablemanager.getdrawable(appcompatdrawablemanager.java:182) @ android.support.v7.widget.appcompatdrawablemanager.checkvectordrawablesetup(appcompatdrawablemanager.java:717) @ android.support.v7.widget.appcompatdrawablemanager.getdrawable(appcompatdrawablemanager.java:187) @ android.support.v7.widget.tinttypedarray.getdrawableifknown(tinttypedarray.java:77) @ android.support.v7.app.appcompatdelegateimplbase.<init>(appcompatdelegateimplbase.java:127) @ android.support.v7.app.appcompatdelegateimplv9.<init>(appcompatdelegateimplv9.java:147) @ android.support.v7.app.appcompatdelegateimplv11.<init>(appcompatdelegateimplv11.java:27) @ android.support.v7.app.appcompatdelegateimplv14.<init>(appcompatdelegateimplv14.java:50) @ android.support.v7.app.appcompatdelegate.create(appcompatdelegate.java:201) @ android.support.v7.app.appcompatdelegate.create(appcompatdelegate.java:181) @ android.support.v7.app.appcompatactivity.getdelegate(appcompatactivity.java:521) @ android.support.v7.app.appcompatactivity.oncreate(appcompatactivity.java:71) @ com.android.co_lay_demo.fab_and_snackbar.oncreate(fab_and_snackbar.java:20) @ android.app.activity.performcreate(activity.java:5047) @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1094) @ android.app.activitythread.performlaunchactivity(activitythread.java:2056) @ android.app.activitythread.handlelaunchactivity(activitythread.java:2117) @ android.app.activitythread.access$700(activitythread.java:134) @ android.app.activitythread$h.handlemessage(activitythread.java:1218) @ android.os.handler.dispatchmessage(handler.java:99) @ android.os.looper.loop(looper.java:137) @ android.app.activitythread.main(activitythread.java:4867) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:511) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:1007) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:774) @ dalvik.system.nativestart.main(native method)
if downgrade version of dependencies to,
compile 'com.android.support:appcompat-v7:23.0.1' compile 'com.android.support:design:23.0.1'
the app runs without error.
my xml file looks like,
<android.support.design.widget.coordinatorlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/coordinatorlayout" 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.sample.foo.usingcoordinatorlayout.fabandsnackbaractivity"> <button android:id="@+id/showsnackbarbutton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:text="show_snackbar"/> <android.support.design.widget.floatingactionbutton android:id="@+id/fab" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|right" android:layout_marginbottom="@dimen/activity_vertical_margin" android:layout_marginright="@dimen/activity_horizontal_margin" android:src="@android:drawable/ic_popup_disk_full"/>
am missing according new versions?
replace gradle version
classpath 'com.android.tools.build:gradle:2.1.3'
Comments
Post a Comment