2014-02-14 122 views
0

我試圖使用ImageLoader獲取下面的兩個圖像,我得到一個EACCES(權限被拒絕)。我錯過了什麼?通過ImageLoader下載圖像

在我的表現,我有:

<uses-permission android:name="android.permission.INTERNET" />

網址: http://projectcaruso.com/android/com.projectcaruso/idea/dumpfolder/345 http://projectcaruso.com/android/com.projectcaruso/idea/dumpfolder/342

我叫它爲:

LocalImageLoader imageLoader=new LocalImageLoader(FeedActivity.this); imageLoader.DisplayImage(URL, image);

02-14 13:39:51.270: W/System.err(9446): java.io.FileNotFoundException: /storage/emulated/0/LazyList/-649435551: open failed: EACCES (Permission denied) 
02-14 13:39:51.270: W/System.err(9446):  at libcore.io.IoBridge.open(IoBridge.java:409) 
02-14 13:39:51.270: W/System.err(9446):  at java.io.FileOutputStream.<init>(FileOutputStream.java:88) 
02-14 13:39:51.270: W/System.err(9446):  at java.io.FileOutputStream.<init>(FileOutputStream.java:73) 
02-14 13:39:51.270: W/System.err(9446):  at com.projectCaruso.idea.LocalImageLoader.getBitmap(LocalImageLoader.java:72) 
02-14 13:39:51.270: W/System.err(9446):  at com.projectCaruso.idea.LocalImageLoader.access$0(LocalImageLoader.java:54) 
02-14 13:39:51.270: W/System.err(9446):  at com.projectCaruso.idea.LocalImageLoader$PhotosLoader.run(LocalImageLoader.java:132) 
02-14 13:39:51.270: W/System.err(9446):  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390) 
02-14 13:39:51.270: W/System.err(9446):  at java.util.concurrent.FutureTask.run(FutureTask.java:234) 
02-14 13:39:51.270: W/System.err(9446):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) 
02-14 13:39:51.270: W/System.err(9446):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) 
02-14 13:39:51.270: W/System.err(9446):  at java.lang.Thread.run(Thread.java:841) 
02-14 13:39:51.270: W/System.err(9446): Caused by: libcore.io.ErrnoException: open failed: EACCES (Permission denied) 
02-14 13:39:51.270: W/System.err(9446):  at libcore.io.Posix.open(Native Method) 
02-14 13:39:51.270: W/System.err(9446):  at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110) 
02-14 13:39:51.270: W/System.err(9446):  at libcore.io.IoBridge.open(IoBridge.java:393) 
02-14 13:39:51.270: W/System.err(9446):  ... 10 more 
02-14 13:39:51.290: W/System.err(9446): java.io.FileNotFoundException: /storage/emulated/0/LazyList/-649435554: open failed: EACCES (Permission denied) 
02-14 13:39:51.290: W/System.err(9446):  at libcore.io.IoBridge.open(IoBridge.java:409) 
02-14 13:39:51.290: W/System.err(9446):  at java.io.FileOutputStream.<init>(FileOutputStream.java:88) 
02-14 13:39:51.290: W/System.err(9446):  at java.io.FileOutputStream.<init>(FileOutputStream.java:73) 
02-14 13:39:51.290: W/System.err(9446):  at com.projectCaruso.idea.LocalImageLoader.getBitmap(LocalImageLoader.java:72) 
02-14 13:39:51.290: W/System.err(9446):  at com.projectCaruso.idea.LocalImageLoader.access$0(LocalImageLoader.java:54) 
02-14 13:39:51.290: W/System.err(9446):  at com.projectCaruso.idea.LocalImageLoader$PhotosLoader.run(LocalImageLoader.java:132) 
02-14 13:39:51.300: W/System.err(9446):  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390) 
02-14 13:39:51.300: W/System.err(9446):  at java.util.concurrent.FutureTask.run(FutureTask.java:234) 
02-14 13:39:51.300: W/System.err(9446):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) 
02-14 13:39:51.300: W/System.err(9446):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) 
02-14 13:39:51.300: W/System.err(9446):  at java.lang.Thread.run(Thread.java:841) 
02-14 13:39:51.300: W/System.err(9446): Caused by: libcore.io.ErrnoException: open failed: EACCES (Permission denied) 
02-14 13:39:51.300: W/System.err(9446):  at libcore.io.Posix.open(Native Method) 
02-14 13:39:51.300: W/System.err(9446):  at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110) 
02-14 13:39:51.300: W/System.err(9446):  at libcore.io.IoBridge.open(IoBridge.java:393) 
02-14 13:39:51.300: W/System.err(9446):  ... 10 more 
02-14 13:39:51.310: W/System.err(9446): java.io.FileNotFoundException: /storage/emulated/0/LazyList/-649435551: open failed: EACCES (Permission denied) 
02-14 13:39:51.310: W/System.err(9446):  at libcore.io.IoBridge.open(IoBridge.java:409) 
02-14 13:39:51.310: W/System.err(9446):  at java.io.FileOutputStream.<init>(FileOutputStream.java:88) 
02-14 13:39:51.310: W/System.err(9446):  at java.io.FileOutputStream.<init>(FileOutputStream.java:73) 
02-14 13:39:51.310: W/System.err(9446):  at com.projectCaruso.idea.LocalImageLoader.getBitmap(LocalImageLoader.java:72) 
02-14 13:39:51.310: W/System.err(9446):  at com.projectCaruso.idea.LocalImageLoader.access$0(LocalImageLoader.java:54) 
02-14 13:39:51.310: W/System.err(9446):  at com.projectCaruso.idea.LocalImageLoader$PhotosLoader.run(LocalImageLoader.java:132) 
02-14 13:39:51.310: W/System.err(9446):  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390) 
02-14 13:39:51.310: W/System.err(9446):  at java.util.concurrent.FutureTask.run(FutureTask.java:234) 
02-14 13:39:51.310: W/System.err(9446):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) 
02-14 13:39:51.310: W/System.err(9446):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) 
02-14 13:39:51.310: W/System.err(9446):  at java.lang.Thread.run(Thread.java:841) 
02-14 13:39:51.310: W/System.err(9446): Caused by: libcore.io.ErrnoException: open failed: EACCES (Permission denied) 
02-14 13:39:51.310: W/System.err(9446):  at libcore.io.Posix.open(Native Method) 
02-14 13:39:51.310: W/System.err(9446):  at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110) 
02-14 13:39:51.310: W/System.err(9446):  at libcore.io.IoBridge.open(IoBridge.java:393) 
02-14 13:39:51.310: W/System.err(9446):  ... 10 more 
02-14 13:39:51.361: W/System.err(9446): java.io.FileNotFoundException: /storage/emulated/0/LazyList/-649435554: open failed: EACCES (Permission denied) 
02-14 13:39:51.361: W/System.err(9446):  at libcore.io.IoBridge.open(IoBridge.java:409) 
02-14 13:39:51.361: W/System.err(9446):  at java.io.FileOutputStream.<init>(FileOutputStream.java:88) 
02-14 13:39:51.361: W/System.err(9446):  at java.io.FileOutputStream.<init>(FileOutputStream.java:73) 
02-14 13:39:51.361: W/System.err(9446):  at com.projectCaruso.idea.LocalImageLoader.getBitmap(LocalImageLoader.java:72) 
02-14 13:39:51.361: W/System.err(9446):  at com.projectCaruso.idea.LocalImageLoader.access$0(LocalImageLoader.java:54) 
02-14 13:39:51.361: W/System.err(9446):  at com.projectCaruso.idea.LocalImageLoader$PhotosLoader.run(LocalImageLoader.java:132) 
02-14 13:39:51.361: W/System.err(9446):  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390) 
02-14 13:39:51.361: W/System.err(9446):  at java.util.concurrent.FutureTask.run(FutureTask.java:234) 
02-14 13:39:51.361: W/System.err(9446):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) 
02-14 13:39:51.361: W/System.err(9446):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) 
02-14 13:39:51.361: W/System.err(9446):  at java.lang.Thread.run(Thread.java:841) 
02-14 13:39:51.361: W/System.err(9446): Caused by: libcore.io.ErrnoException: open failed: EACCES (Permission denied) 
02-14 13:39:51.361: W/System.err(9446):  at libcore.io.Posix.open(Native Method) 
02-14 13:39:51.361: W/System.err(9446):  at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110) 
02-14 13:39:51.361: W/System.err(9446):  at libcore.io.IoBridge.open(IoBridge.java:393) 
02-14 13:39:51.361: W/System.err(9446):  ... 10 more 
02-14 13:39:51.631: W/System.err(9446): java.io.FileNotFoundException: /storage/emulated/0/LazyList/-649435551: open failed: EACCES (Permission denied) 
02-14 13:39:51.631: W/System.err(9446):  at libcore.io.IoBridge.open(IoBridge.java:409) 
02-14 13:39:51.631: W/System.err(9446):  at java.io.FileOutputStream.<init>(FileOutputStream.java:88) 
02-14 13:39:51.631: W/System.err(9446):  at java.io.FileOutputStream.<init>(FileOutputStream.java:73) 
02-14 13:39:51.631: W/System.err(9446):  at com.projectCaruso.idea.LocalImageLoader.getBitmap(LocalImageLoader.java:72) 
02-14 13:39:51.631: W/System.err(9446):  at com.projectCaruso.idea.LocalImageLoader.access$0(LocalImageLoader.java:54) 
02-14 13:39:51.631: W/System.err(9446):  at com.projectCaruso.idea.LocalImageLoader$PhotosLoader.run(LocalImageLoader.java:132) 
02-14 13:39:51.631: W/System.err(9446):  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390) 
02-14 13:39:51.631: W/System.err(9446):  at java.util.concurrent.FutureTask.run(FutureTask.java:234) 
02-14 13:39:51.631: W/System.err(9446):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) 
02-14 13:39:51.631: W/System.err(9446):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) 
02-14 13:39:51.631: W/System.err(9446):  at java.lang.Thread.run(Thread.java:841) 
02-14 13:39:51.631: W/System.err(9446): Caused by: libcore.io.ErrnoException: open failed: EACCES (Permission denied) 
02-14 13:39:51.631: W/System.err(9446): java.io.FileNotFoundException: /storage/emulated/0/LazyList/-649435554: open failed: EACCES (Permission denied) 
02-14 13:39:51.631: W/System.err(9446):  at libcore.io.Posix.open(Native Method) 
02-14 13:39:51.631: W/System.err(9446):  at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110) 
02-14 13:39:51.641: W/System.err(9446):  at libcore.io.IoBridge.open(IoBridge.java:393) 
02-14 13:39:51.641: W/System.err(9446):  ... 10 more 
02-14 13:39:51.641: W/System.err(9446): java.io.FileNotFoundException: /storage/emulated/0/LazyList/-649435554: open failed: EACCES (Permission denied) 
02-14 13:39:51.641: W/System.err(9446):  at libcore.io.IoBridge.open(IoBridge.java:409)java.io.FileNotFoundException: /storage/emulated/0/LazyList/-649435551: open failed: EACCES (Permission denied) 
02-14 13:39:51.641: W/System.err(9446):  at libcore.io.IoBridge.open(IoBridge.java:409) 
02-14 13:39:51.641: W/System.err(9446):  at java.io.FileOutputStream.<init>(FileOutputStream.java:88) 
02-14 13:39:51.641: W/System.err(9446):  at java.io.FileOutputStream.<init>(FileOutputStream.java:73) 
02-14 13:39:51.641: W/System.err(9446):  at com.projectCaruso.idea.LocalImageLoader.getBitmap(LocalImageLoader.java:72) 
02-14 13:39:51.641: W/System.err(9446):  at com.projectCaruso.idea.LocalImageLoader.access$0(LocalImageLoader.java:54) 
02-14 13:39:51.641: W/System.err(9446):  at com.projectCaruso.idea.LocalImageLoader$PhotosLoader.run(LocalImageLoader.java:132) 
02-14 13:39:51.641: W/System.err(9446):  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390) 
02-14 13:39:51.641: W/System.err(9446):  at java.util.concurrent.FutureTask.run(FutureTask.java:234) 
02-14 13:39:51.641: W/System.err(9446):  at at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)libcore.io.IoBridge.open(IoBridge.java:409) 
02-14 13:39:51.641: W/System.err(9446):  at java.io.FileOutputStream.<init>(FileOutputStream.java:88) 
02-14 13:39:51.641: W/System.err(9446):  at java.io.FileOutputStream.<init>(FileOutputStream.java:73) 
02-14 13:39:51.641: W/System.err(9446):  at com.projectCaruso.idea.LocalImageLoader.getBitmap(LocalImageLoader.java:72) 
02-14 13:39:51.641: W/System.err(9446):  at com.projectCaruso.idea.LocalImageLoader.access$0(LocalImageLoader.java:54) 
02-14 13:39:51.641: W/System.err(9446):  at com.projectCaruso.idea.LocalImageLoader$PhotosLoader.run(LocalImageLoader.java:132) 
02-14 13:39:51.641: W/System.err(9446):  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390) 
02-14 13:39:51.641: W/System.err(9446):  at java.util.concurrent.FutureTask.run(FutureTask.java:234) 
02-14 13:39:51.641: W/System.err(9446):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) 
02-14 13:39:51.641: W/System.err(9446):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) 
02-14 13:39:51.641: W/System.err(9446):  at java.lang.Thread.run(Thread.java:841) 
02-14 13:39:51.641: W/System.err(9446): Caused by: libcore.io.ErrnoException: open failed: EACCES (Permission denied) 
02-14 13:39:51.641: W/System.err(9446):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) 
02-14 13:39:51.641: W/System.err(9446):  at java.lang.Thread.run(Thread.java:841) 
02-14 13:39:51.641: W/System.err(9446): Caused by: libcore.io.ErrnoException: open failed: EACCES (Permission denied) 
02-14 13:39:51.641: W/System.err(9446):  at java.io.FileOutputStream.<init>(FileOutputStream.java:88) 
02-14 13:39:51.641: W/System.err(9446):  at java.io.FileOutputStream.<init>(FileOutputStream.java:73) 
02-14 13:39:51.651: W/System.err(9446):  at at libcore.io.Posix.open(Native Method) 
02-14 13:39:51.651: W/System.err(9446):  at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110) 
02-14 13:39:51.651: W/System.err(9446):  at libcore.io.IoBridge.open(IoBridge.java:393) 
02-14 13:39:51.651: W/System.err(9446):  ... 10 more 
02-14 13:39:51.651: W/System.err(9446):  at libcore.io.Posix.open(Native Method) 
02-14 13:39:51.651: W/System.err(9446):  at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110) 
02-14 13:39:51.651: W/System.err(9446):  at libcore.io.IoBridge.open(IoBridge.java:393) 
02-14 13:39:51.651: W/System.err(9446):  ... 10 more 
02-14 13:39:51.651: W/System.err(9446): com.projectCaruso.idea.LocalImageLoader.getBitmap(LocalImageLoader.java:72) 
02-14 13:39:51.651: W/System.err(9446):  at com.projectCaruso.idea.LocalImageLoader.access$0(LocalImageLoader.java:54) 
02-14 13:39:51.651: W/System.err(9446):  at com.projectCaruso.idea.LocalImageLoader$PhotosLoader.run(LocalImageLoader.java:132) 
02-14 13:39:51.651: W/System.err(9446):  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390) 
02-14 13:39:51.651: W/System.err(9446):  at java.util.concurrent.FutureTask.run(FutureTask.java:234) 
02-14 13:39:51.651: W/System.err(9446):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) 
02-14 13:39:51.651: W/System.err(9446):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) 
02-14 13:39:51.651: W/System.err(9446):  at java.lang.Thread.run(Thread.java:841) 
02-14 13:39:51.651: W/System.err(9446): Caused by: libcore.io.ErrnoException: open failed: EACCES (Permission denied) 
02-14 13:39:51.651: W/System.err(9446):  at libcore.io.Posix.open(Native Method) 
02-14 13:39:51.651: W/System.err(9446):  at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110) 
02-14 13:39:51.651: W/System.err(9446):  at libcore.io.IoBridge.open(IoBridge.java:393) 
02-14 13:39:51.651: W/System.err(9446):  ... 10 more 
+0

u需要寫入權限存儲..圖像加載器試圖緩存它在磁盤(二級緩存)..因爲你沒有權限來寫它FileNotFoundException異常結束 – Atrix1987

+0

感謝爲什麼發生了詳細的解釋。 – jcaruso

回答

5

,因爲你是GET ting此消息

java.io.FileNotFoundException: /storage/emulated/0/LazyList/-649435551: open failed: EACCES (Permission denied) 

你有嗎?

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
+1

我沒有!你的我最好的油炸了!謝謝您的幫助 – jcaruso

相關問題