我正在編寫一個安卓應用程序,該應用程序在我創建的anims
和drawable
文件夾中有多個活動和文件。直到今天,我還在android 4.2
中運行並測試了我的應用程序,它運行良好,仍然有效。但今天我試圖運行它在android 2.2 and 2.3.3
。但是,即使minSdkVersion
設置爲8 (android 2.2)
,它也會失敗,它將拋出exeption
,低於該值我找不到任何解決方案。你有這個錯誤的任何解決方案。我真的無法找到關於網絡的任何信息。謝謝。ArgbEvaluator錯誤Android 2.2和Android 2.3.3
這是它拋出錯誤:
@SuppressLint("NewApi")
public void slideUpDown(final View view) {
final Animation bottomUp = AnimationUtils.loadAnimation(this, R.anim.sowc_bottom_up);
final Animation bottomDown = AnimationUtils.loadAnimation(this, R.anim.sowc_bottom_down);
if (!isPanelShown()) {
hiddenPanel.startAnimation(bottomUp);
hiddenPanel.setVisibility(View.VISIBLE);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
ObjectAnimator colorFade = ObjectAnimator.ofObject(view, "backgroundColor", new ArgbEvaluator(), Color.argb(0, 0, 0, 0), Color.argb(200, 0, 0, 0));
colorFade.setDuration(300);
colorFade.start();
}
}, 300);
}
else {
ObjectAnimator colorFade = ObjectAnimator.ofObject(view, "backgroundColor", new ArgbEvaluator(), Color.argb(200, 0, 0, 0), Color.argb(0, 0, 0, 0));
colorFade.setDuration(300);
colorFade.start();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
hiddenPanel.startAnimation(bottomDown);
hiddenPanel.setVisibility(View.GONE);
}
}, 200);
}
}
FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: android.animation.ArgbEvaluator
at com.inovarge.shoponway.activities.LoginActivity$1.run(LoginActivity.java:64)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3683)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
['ArgbEvaluator'在API級別11中添加](https://developer.android.com/reference/android/animation/ArgbEvaluator.html) – adneal