Answer the question
In order to leave comments, you need to log in
What is the rendering issue in Android Studio?
Just a few hours ago everything was working fine. Now, when creating a new project or opening an old one, errors appear and nothing is edited. How to fix it?
Answer the question
In order to leave comments, you need to log in
Finally got to here!
The problem is with the last one AppCompat 23.2.0
.
This version introduced support for VectorDrawableCompat
.
Now vector assets will no longer be converted to bitmaps at build time.
However, the studio is unaware of this and automatically decides to do it again.
Therefore, you need to register a special flag in Gradle
your project,
otherwise it will crash, the same exception
as yours.
1st option (if you have version Gradle wrapper >= 2.0
):
android {
defaultConfig {
vectorDrawables.useSupportLibrary = true
}
}
Gradle wrapper == 1.5
; most likely it will suit you)android {
defaultConfig {
// Stops the Gradle plugin’s automatic rasterization of vectors
generatedDensities = []
}
// Flag to tell aapt to keep the attribute ids around
aaptOptions {
additionalParameters "--no-version-vectors"
}
}
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_search"/>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question