java.lang.NoClassDefFoundError: android/os/AsyncTask がでてるけど

こゆのでてない?

java.lang.NoClassDefFoundError: com.myapp.MyClassExtendingAsyncTask
at com.myapp.x.run(SourceFile:417)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3859)
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:889)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:647)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.myapp.MyClassExtendingAsyncTask in loader dalvik.system.PathClassLoader[/data/app/com.myapp-1.apk]
at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)

あたし的には, 2.x 系ででてるけど, それだけではないのか.

java.lang.NoClassDefFoundError: android/os/AsyncTask - Google グループ

Issue 81083 - android - java.lang.ClassNotFoundException: android.os.AsyncTask caused by AdMob / Google Play Services - Android Open Source Project - Issue Tracker - Google Project Hosting

解決方法としては以下が挙げられてる.

try
{
Class.forName("android.os.AsyncTask"); //it prevents AdMob from crashing on HTC with Android 4.0.x
}
catch(Throwable ignored)
{}

The AsyncTask class must be loaded on the UI thread. This is done automatically as of JELLY_BEAN.

これはどこがアナウンスするべきなのだろうか.

他にもいろいろあるような気もするけども.

java - What is the difference between NoClassDefFoundError and ClassNotFoundException? - Stack Overflow


関連ワード:  AndroidGoogleアプリニュース速報開発