Resources$NotFoundException: File res/drawable/abc_ic_ab_back_material.xml
IF you're using Gradle Plugin 2.0, you need to make changes in your gradle
:
// Gradle Plugin 2.0+
android {
defaultConfig {
vectorDrawables.useSupportLibrary = true
}
}
If you are using Gradle 1.5 you’ll use instead of previus:
// Gradle Plugin 1.5
android {
defaultConfig {
// Stops the Gradle plugin's automatic rasterization of vectors
generatedDensities = []
}
// Flag to tell aapt to keep the attribute ids around
// This is handled for you by the 2.0+ Gradle Plugin
aaptOptions {
additionalParameters "--no-version-vectors"
}
}
Check also: Update Android Support Library to 23.2.0 cause error: XmlPullParserException Binary XML file line #17<vector> tag requires viewportWidth > 0.
Android Support Library Ref.: Support Vector Drawables and Animated Vector Drawables.
Also update Android Support dependencies from
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
to
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support:design:24.2.0'
compile 'com.android.support:recyclerview-v7:24.2.0'
compile 'com.android.support:cardview-v7:24.2.0'
as you're already using build-tools in version of 24.0.2
.
If any of the other solutions does not work, you can add this line in your Activity
static {
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
}
and of course, update your gradle and appcompat to the latest versions. This worked in my case.
None of these worked for me. But this did:
Change
android:src="@drawable/your_drawable"
to
app:srcCompat="@drawable/your_drawable"