0

I recently started Androids Studio, I bought a quiz game and I tried to modify it a bit with the help of some tutorials, only when I want to generate the apk I get some errors, I tried to do everything from the beginning about 10 times and the same, I don't know where I'm wrong, you have below a link with a video with the errors. Thank you in advance!!! https://www.youtube.com/watch?v=59fxv4F5DYE

1 Answers1

0

I guess you are getting an error due to using Vector drawables which are supported on Android API 21 and above and your minSdk is lower than 21. The solution to this is either update your minSdk version to be at least 21.

Or in your gradle.build:

android {  
    defaultConfig {  
        vectorDrawables.useSupportLibrary = true  
    }  
}

And in application class define this:

@Override
public void onCreate() {
    super.onCreate();
    AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
}

And when using the resource for example in your ImageView:

<ImageView
     ...
     app:srcCompat="@drawable/ic_some_vector" />
Stoyan Milev
  • 725
  • 4
  • 17