I am using Design Support Library version 23.4.0. I have enabled the gradle flag:
defaultConfig {
vectorDrawables.useSupportLibrary = tr
Inflating Drawable's
`VectorDrawable` and `AnimatedVectorDrawable` in this support library can be inflated in this way:
getDrawable() methods://This will only inflate a drawable withas the root element VectorDrawable.getDrawable(context, R.drawable.ic_arrow_vector); //This will only inflate a drawable with as the root element AnimatedVectorDrawable.getDrawable(context, R.drawable.ic_arrow_to_menu_animated_vector); // This will inflate any drawable and will auto-fallback to the lollipop implementation on api 21+ devices ResourcesCompat.getDrawable(context, R.drawable.any_drawable);
If inflating the Drawable in java code, it is recommended to always use ResourcesCompat.getDrawable() as this handles Lollipop fallback when applicable. This allows the system to cache Drawable ConstantState and hence is more efficient.
The library has the following morph (bi-directional) animations :
API 16 phone:import com.wnafee.vector.compat.AnimatedVectorDrawable;
mdrawable = (AnimatedVectorDrawable) AnimatedVectorDrawable.getDrawable(this.getApplicationContext(), R.drawable.consolidated_animated_vector);
Look at the github README for vector-compat here: https://github.com/wnafee/vector-compat
This will fix your problem (down to API 14) if you merge it with your app module's build.gradle dependencies (usually at the end of file):
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
//Trying to FIX Binary XML file line #2: invalid drawable tag animated-vector
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.android.support:design:25.0.0'
//not needed
// compile 'com.android.support:support-vector-drawable:25.0.0'
compile 'com.wnafee:vector-compat:1.0.5'//*******holy grail *******https://github.com/wnafee/vector-compat
// Failed to resolve: com.android.support:support-animated-vector-drawable:25.0.0
//not needed
// compile 'com.android.support:support-animated-vector-drawable:25.0.0'
}