首页 > 解决方案 > AnimatedVectorDrawable 未在 Android 8.0.0 上运行

问题描述

我一直在测试AnimatedVectotDrawable API 来为矢量绘图设置动画,当我在 Android 8.0.0 物理设备上运行它时它只显示动画的结尾(无动画)。

我在 Android Q AVD 上进行了测试,它运行良好。这是我的 Gradle 脚本:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.nic"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
    implementation 'com.google.android.material:material:1.0.0'
}

请告知我是否遗漏了什么

标签: androidanimatedvectordrawable

解决方案


推荐阅读