过去我的应用程序过去运行正常,但现在应用程序已经开始给我一个错误,并且每当我尝试打开它时它都没有响应。我在代码中尝试做的是从Parse.com获取对象。我目前在我的应用程序中有三个选项卡,这是第二个选项卡的代码。 这是代码: 更新:我设法让应用有效。问题是我给Parsefile分配了错误的值。
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: Process: ope.playingwithtabs, PID: 7054
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: java.lang.RuntimeException: An error occurred while executing doInBackground()
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at android.os.AsyncTask$3.done(AsyncTask.java:309)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at java.util.concurrent.FutureTask.run(FutureTask.java:242)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at java.lang.Thread.run(Thread.java:818)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lbolts/Task;
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at com.parse.ParseQuery.checkIfRunning(ParseQuery.java:952)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at com.parse.ParseQuery.doWithRunningCheck(ParseQuery.java:1129)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at com.parse.ParseQuery.findAsync(ParseQuery.java:1193)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at com.parse.ParseQuery.findInBackground(ParseQuery.java:1161)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at com.parse.ParseQuery.find(ParseQuery.java:981)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at ope.playingwithtabs.TwoFragment$RemoteDataTask.doInBackground(TwoFragment.java:79)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at ope.playingwithtabs.TwoFragment$RemoteDataTask.doInBackground(TwoFragment.java:53)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at android.os.AsyncTask$2.call(AsyncTask.java:295)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at java.lang.Thread.run(Thread.java:818)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "bolts.Task" on path: DexPathList[[zip file "/data/app/ope.playingwithtabs-2/base.apk"],nativeLibraryDirectories=[/data/app/ope.playingwithtabs-2/lib/x86, /vendor/lib, /system/lib]]
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at com.parse.ParseQuery.checkIfRunning(ParseQuery.java:952)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at com.parse.ParseQuery.doWithRunningCheck(ParseQuery.java:1129)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at com.parse.ParseQuery.findAsync(ParseQuery.java:1193)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at com.parse.ParseQuery.findInBackground(ParseQuery.java:1161)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at com.parse.ParseQuery.find(ParseQuery.java:981)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at ope.playingwithtabs.TwoFragment$RemoteDataTask.doInBackground(TwoFragment.java:79)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at ope.playingwithtabs.TwoFragment$RemoteDataTask.doInBackground(TwoFragment.java:53)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at android.os.AsyncTask$2.call(AsyncTask.java:295)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at java.lang.Thread.run(Thread.java:818)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: Suppressed: java.lang.ClassNotFoundException: bolts.Task
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at java.lang.Class.classForName(Native Method)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: ... 14 more
03-20 17:09:12.478 7054-7079/ope.playingwithtabs E/AndroidRuntime: Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
03-20 17:09:13.101 7054-7078/ope.playingwithtabs E/Surface: getSlotFromBufferLocked: unknown buffer: 0xabee5fe0
03-20 17:09:13.118 7054-7078/ope.playingwithtabs E/Surface: getSlotFromBufferLocked: unknown buffer: 0xabee67c0
这是我运行代码时出现的logcat错误:
final String dataCorrupted = ":ok " + "event: data"
+ "data: {\"target\":42,\"data\": `{\"text\":\"string\",\"numer\":0,\"id\":1234214214,\"likes\":0,\"isNewInstance\":true,\"created\":1458493863596,\"edited\":1458493863596},\"type\":\"create\"}`";
final String data = dataCorrupted.substring(dataCorrupted.indexOf("{"), dataCorrupted.lastIndexOf("}") + 1);
System.out.println(data);
答案 0 :(得分:0)
看起来你的某些文件没有被编译。上次遇到此问题时,我删除了app/build
文件夹,让Gradle再次构建项目。这对我有用。