Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid : java.lang.NoClassDefFoundError File
    primarykey
    data
    text
    <p>This is my code:</p> <pre><code> public static void deleteFile(stPath){ File yourDir = new File(stPath); **// Line 210 in MyUtil.java** // .... /// } </code></pre> <p>and I call it in AsynTask method:</p> <pre><code>private class Backup extends AsyncTask&lt;String, Void, Exception&gt; { @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)); } } </code></pre> <p>When I run, it throw a error java.lang.NoClassDefFoundError. Android cannot find java.io.File?? I don't understand. Can you explain for me? </p> <p>This is my logcat:</p> <pre><code>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) ------------------------------- </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload