我正在使用一些动画(我认为PathMeasure()导致问题,在我的代码中没有其他不寻常的东西)。如何更改AndroidStudio中的支持库?
当我在android 5.0 +中测试我的应用程序时,没有问题并且运行良好。 但是,当涉及到Android 4.4.4,屏幕上没有任何东西。 它没有崩溃,但在logcat的一个错误:
Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method android.support.v7.widget.AppCompatImageHelper.hasOverlappingRendering
我发现了这样的建议:
...任何版本<支持库21中的方法不执行任何...不在旧版本上崩溃,而不是实际提供该功能。 使用支持库22.1,您可以使用。
如何使用支持库22.1? 我目前的设置有什么问题?
我的build.gradle文件:
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "com.example.asd.anim"
minSdkVersion 18
targetSdkVersion 24
...
}
depencencies {
...
compile 'com.android.support:appcompat-v7:24.2.1'
}
你利用的'在你的代码的任何地方RippleDrawable'?它直到API 21才被添加,所以自然不适用于较旧的API版本。 – clownba0t
我没有直接使用'RippleDrawable',而是'PathMeasure'以某种方式使用它(或类似的东西):D 但是禁用硬件加速解决了这个问题。 – thatsmyname