java.lang.IllegalStateException: This app has been built with an incorrect configuration. Please configure your build for VectorDrawableCompat.

Today we faced an issue in android studio. when we clicked on play button after done with our coding and layouts. Suddenly an error occurred, which is quite weird or unseen before. Then we changed extended class "AppCompatActivity" to "Activity" and it worked fine. But this was not the solution, it was just alternate way to run the app. We searched about it and found that this error is related to gradle. We solved it and you can also solve by following some easy steps.



Error :

java.lang.IllegalStateException: This app has been built with an incorrect configuration. Please configure your build for VectorDrawableCompat.


Mayadi - A Knowledge Source
Error Screenshot


Solution :

Step 1 : Select build.gradle (Module : app).



Mayadi - A Knowledge Source
build.gradle



Step 2 : paste this before buildTypes.


aaptOptions {
    additionalParameters "--no-version-vectors"}



Mayadi - A Knowledge Source
Paste Code here







Step 3 : paste this inside defaultConfig just after versionName.


generatedDensities = []





Mayadi - A Knowledge Source
Paste here


Step 4 : Now Just sync the gradle. After syncing, run the app and you will find that this time there is no error. Your app will run smoothly.


Mayadi - A Knowledge Source
Sync Gradle



Comments

  1. I appreciate that you produced this wonderful article to help us get more knowledge about this topic. I know, it is not an easy task to write such a big article in one day, I've tried that and I've failed. But, here you are, trying the big task and finishing it off and getting good comments and ratings. That is one hell of a job done!
    Data Science training in rajaji nagar
    Data Science with Python training in chennai
    Data Science training in electronic city
    Data Science training in USA
    Data science training in bangalore

    ReplyDelete

Post a Comment