0

I´m trying to get SVGs on an older API, but when I start the activity where the SVG is located, the app brokes. It is working on a 6.0 device, but not on 4.2.2

it comes with

android.view.InflateException: Binary XML file line #21: Error inflating class ImageView

I imported the SVG with the Android Vector Asset, also with this one http://inloop.github.io/svg2android/ But it doesen´t make a different.

This is how I call the SVG:

   <ImageView
    android:layout_width="wrap_content"
    android:layout_height="50dp"
    android:id="@+id/imageView4"
    android:layout_centerHorizontal="true"
    android:src="@drawable/map2"
    android:layout_alignParentTop="true" />

my gradle:

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"

defaultConfig {
    vectorDrawables.useSupportLibrary = true
    applicationId "com.example.jendrik.moerder"
    minSdkVersion 14
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.2.+'
    compile 'com.android.support:support-v4:23.2.+'
    compile 'com.android.support:percent:23.2.+'
    compile 'com.android.support:design:23.2.+'
    compile 'com.android.support:recyclerview-v7:23.2.+'
}

Does anybody has a clue? Thanks a lot!!

Jendrik
  • 57
  • 9
  • 1
    see my answer [here](http://stackoverflow.com/questions/34417843/how-to-use-vector-drawables-in-android-api-lower-21/36661438#36661438) – mehrdad khosravi Apr 17 '16 at 10:37
  • Thanks for your answer. I know your post, because this was my source. I followed your description before I posted this question. Could you tell me what I did different? – Jendrik Apr 17 '16 at 14:48
  • Found my mistake. I used "android:src="@drawable/map2" instead of app:srcCompat – Jendrik Apr 17 '16 at 16:10

0 Answers0