これは私のコードです:
public static void deleteFile(stPath){
File yourDir = new File(stPath); **// Line 210 in MyUtil.java**
//
....
///
}
そして私はそれを AsynTask メソッドで呼び出します:
private class Backup extends AsyncTask<String, Void, Exception> {
@Override
protected void onPreExecute() {
showProgressDialog(StringUtil.getString(R.string.backucking));
}
@Override
protected Exception doInBackground(String... params) {
deleteFile(stPath);
return null;
}
@Override
protected void onPostExecute(Exception result) {
showProgressDialog(StringUtil.getString(R.string.downloading));
}
}
実行すると、エラー java.lang.NoClassDefFoundError がスローされます。Android は java.io.File を見つけられませんか?? 理解できない。説明してもらえますか?
これは私のlogcatです:
java.lang.RuntimeException: An error occured while executing doInBackground()
--------- Stack trace ---------
android.os.AsyncTask$3.done(AsyncTask.java:299)
java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
java.util.concurrent.FutureTask.setException(FutureTask.java:124)
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
java.util.concurrent.FutureTask.run(FutureTask.java:137)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
java.lang.Thread.run(Thread.java:856)
-------------------------------
--------- Cause ---------
java.lang.NoClassDefFoundError: mypakage/d/a/b/d
com.mypakage.util.b.e(MyUtil.java:210)
com.mypakage.view.main.f.a(OneView.java:1046)
com.mypakage.view.main.f.doInBackground(OneView.java:1)
android.os.AsyncTask$2.call(AsyncTask.java:287)
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
java.util.concurrent.FutureTask.run(FutureTask.java:137)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
java.lang.Thread.run(Thread.java:856)
-------------------------------