我试图通过AsyncTask在操作Own Cloud服务器中完成读取和创建文件夹,使用我的凭据登录到服务器已成功完成,但在尝试创建文件夹并在日志中读取以下错误时如下所述,这可能是导致错误的原因吗?
04-07 15:45:24.500: I/OwnCloud(31352): Sending File
04-07 15:45:24.510: I/OwnCloud(31352): Start Read Remote Folder
04-07 15:45:24.620: I/ReadRemoteFolderOperation(31352): Synchronized /: Operation finished with HTTP status code 207 (success)
04-07 15:45:24.630: I/OwnCloud(31352): Sending File
04-07 15:45:24.630: W/dalvikvm(31352): threadid=11: thread exiting with uncaught exception (group=0x40ffe438)
04-07 15:45:24.640: E/AndroidRuntime(31352): FATAL EXCEPTION: AsyncTask #1
04-07 15:45:24.640: E/AndroidRuntime(31352): java.lang.RuntimeException: An error occured while executing doInBackground()
04-07 15:45:24.640: E/AndroidRuntime(31352): at android.os.AsyncTask$3.done(AsyncTask.java:299)
04-07 15:45:24.640: E/AndroidRuntime(31352): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
04-07 15:45:24.640: E/AndroidRuntime(31352): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
04-07 15:45:24.640: E/AndroidRuntime(31352): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
04-07 15:45:24.640: E/AndroidRuntime(31352): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
04-07 15:45:24.640: E/AndroidRuntime(31352): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
04-07 15:45:24.640: E/AndroidRuntime(31352): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
04-07 15:45:24.640: E/AndroidRuntime(31352): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
04-07 15:45:24.640: E/AndroidRuntime(31352): at java.lang.Thread.run(Thread.java:856)
04-07 15:45:24.640: E/AndroidRuntime(31352): Caused by: java.lang.ArrayIndexOutOfBoundsException: length=5; index=5
04-07 15:45:24.640: E/AndroidRuntime(31352): at com.prologica.procamera.MainActivity$UploadPhotos.SendFolders(MainActivity.java:127)
04-07 15:45:24.640: E/AndroidRuntime(31352): at com.prologica.procamera.MainActivity$UploadPhotos.doInBackground(MainActivity.java:95)
04-07 15:45:24.640: E/AndroidRuntime(31352): at com.prologica.procamera.MainActivity$UploadPhotos.doInBackground(MainActivity.java:1)
04-07 15:45:24.640: E/AndroidRuntime(31352): at android.os.AsyncTask$2.call(AsyncTask.java:287)
04-07 15:45:24.640: E/AndroidRuntime(31352): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
04-07 15:45:24.640: E/AndroidRuntime(31352): ... 5 more
答案 0 :(得分:1)
在com.prologica.procamera.MainActivity UploadPhotos.SendFolders(MainActivity.java:127)中有一个数组超出范围。检查MainActivity中的第127行以确保您不会超出范围。根据日志,长度为5,您尝试访问索引5(不存在)