NotFoundException: File res/drawable/abc_vector_test.xml from drawable resourceID
来源:互联网 发布:启航网络 编辑:程序博客网 时间:2024/05/16 18:34
华为手机碰到的问题记录-NotFoundException:File res/drawable/abc_vector_test.xml from drawable resource ID
后来在build gradle中加入了
aaptOptions {
additionalParameters "--no-version-vectors"
}
然后就ok了。
Android Support Library 23.2有哪些新东西
应该意识到这不是一个库,而是一套库的集合 ,它们旨在无需新平台的情况下,提供API的向后兼容版本以及新功能。 23.2 版本添加了一些新的支持库,同时还为现有的库增加了新特性。 支持Vector Drawable 和 Animated Vector Drawable Vector drawables 让自己可以用一个定义在XML里的矢量图象替换多个png资源。而之前这一用法只局限于Lollipop以及更高的设备,VectorDrawable和AnimatedVectorDrawable现在可以分别通过两个新的支持库support-vector-drawable 和 support-animated-vector-drawable得到。 Android Studio 1.4 中介绍了一种通过 在编译时生成png 的办法对vector drawable提供了有限的支持。为了禁用这个功能(节省支持库的空间,真正受益于新的库),需要在 build.gradle文件里添加vectorDrawables.useSupportLibrary = true : // Gradle Plugin 2.0+ android { defaultConfig { vectorDrawables.useSupportLibrary = true } } 需要注意这个新的属性只有2.0版本的Gradle Plugin中才有。如果正在使用Gradle 1.则应该使用 // Gradle Plugin 1.5 android { defaultConfig { generatedDensities = [] } // This is handled for you by the 2.0+ Gradle Plugin aaptOptions { additionalParameters "--no-version-vectors" } } 可以使用兼容到API7的VectorDrawableCompat和兼容到API11或者更高的AnimatedVectorDrawableCompat。鉴于安卓加载drawable的方式,并不是每个接受drawable id的地方(比如在一个XML文件中)都支持加载vector drawable。幸好,AppCompat 添加了几个功能让自己更容易使用新的vector drawable。 首先,当自己和ImageView(或者例如 ImageButton 和 FloatingActionButton这样的子类) 一起使用AppCompat的时候,可以使用新的app:srcCompat属性来饮用 vector drawable(而任何其它drawable则用 android:src): <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" app:srcCompat="@drawable/ic_add" /> 并且,如果要在运行时动态的改变drawable,可以使用和之前相同的 setImageResource() 方法 - 这点并没有变。使用AppCompat和app:srcCompat是在app中集成vector drawable最简单可靠的方式。 会发现在Lollipop之前直接在app:srcCompat之外引用vector drawable会失败。但是AppCompat却支持其它drawable 容器比如StateListDrawable, InsetDrawable, LayerDrawable, LevelListDrawable, 或者 RotateDrawable加载vector drawable。使用这种间接的方法,可以在这种情况下使用vector drawable,比如TextView的 android:drawableLeft 属性,本来在正常情况下,它是不支持vector drawable的。 AppCompat夜间白天主题 虽然在能各个版本的app中使用矢量图像已经是一个很大的变化了,但是这个版本还在AppCompat中添加了一个新主题:Theme.AppCompat.DayNight。
阅读全文
0 0
- NotFoundException: File res/drawable/abc_vector_test.xml from drawable resourceID
- 华为手机碰到的问题记录-NotFoundException: File res/drawable/abc_vector_test.xml from drawable resource ID
- Android开发 Resources$NotFoundException: File res/drawable/abc_vector_test.xml from xml
- File res/drawable/abc_vector_test.xml from drawable resource ID
- File res/drawable/abc_vector_test.xml from drawable resource ID
- NotFoundException: File res/drawable/abc_ic_ab_back_material.xml from drawable resource
- Caused by: android.content.res.Resources$NotFoundException: File res/drawable/abc_vector_test.xml fr
- Android资源文件问题:Resources$NotFoundException: File res/drawable/abc_vector_test.xml
- Exception android.content.res.Resources$NotFoundException: File res/drawable/my.xml from drawable re
- android.content.res.Resources$NotFoundException: File res/drawable/ripple_round_blue.xml
- 【BUG】android.content.res.Resources$NotFoundException: File res/drawable-xxhdpi/toolbar_line.png from
- [糊里糊涂解决] android.content.res.Resources$NotFoundException: File res/drawable/selector_edit.xml fro
- Caused by: android.content.res.Resources$NotFoundException: File res/drawable/***
- Resources$NotFoundException drawable-xhdpi from drawable resource
- Caused by: android.content.res.Resources$NotFoundException: File res/drawable-mdpi/
- Caused by: android.content.res.Resources$NotFoundException: File res/drawable/main_tab_conversation_
- 解决appcompat-v7:24包的一些坑NotFoundException: File res/drawable-v19/..
- File res/drawable-xxhdpi-v4/title_bg.9.png from drawable resource ID #0x7f02
- Oozie-4.1.0-cdh5.5.2 安装部署
- IO模型概述
- Android系统架构和SDK目录结构
- Tensorflow中的dynamic shape、static shape及reshape、set_shape
- bigint,int,smallint,tinyint范围—mysql学习笔记
- NotFoundException: File res/drawable/abc_vector_test.xml from drawable resourceID
- mycat更新时字段无法更新异常的解决方案
- Spring-boot的@Valid注解
- ios-Swift面向对象
- linux的.bashrc和profile文件理解
- java 定时 Java:Web应用下实现定时任务的简便方法
- 在开发板上 ping 域名提示无法ping通
- git 本地分支提交到远程分支
- fortify的应用案例(美国军队部署)第二篇战略-为什么选择fortify SCA