Ошибка кэша Пикассо для API 22 (5.1.1) на планшете - PullRequest
0 голосов
/ 14 мая 2018

Я использую Пикассо в программе утилизации, как это:

Picasso.with(context).load(contects.get(position).getLogo()).memoryPolicy(MemoryPolicy.NO_CACHE )
               .networkPolicy(NetworkPolicy.NO_CACHE).error(R.mipmap.ic_launcher).into(holder.ImageView);

но я получаю это в журнале Пикассо:

D/Picasso: Main        created      [R0] Request{https://debo3.com/wp- content/uploads/2017/08/abstract-logo-template_1331-33.jpg}
D/Picasso: Dispatcher  enqueued     [R0]+11ms 
D/Picasso: Hunter      executing    [R0]+14ms 
D/Picasso: Main        created      [R1] Request{https://debo3.com/wpcontent/uploads/2017/08/abstract-logo-template_1331-33.jpg}
D/Picasso: Hunter      joined       [R1]+1ms to [R0]+17ms, [R1]+1ms
W/System.err: remove failed: ENOENT (No such file or directory) : /data/data/com.example.ahmadi.khadamat/cache/picasso-cache/journal.tmp
D/Picasso: Main        created      [R2] Request{https://debo3.com/wp-content/uploads/2017/08/abstract-logo-template_1331-33.jpg}
D/Picasso: Hunter      joined       [R2]+1ms to [R0]+21ms, [R1]+5ms, [R2]+1ms
D/Picasso: Dispatcher  retrying     [R0]+20s, [R1]+20s, [R2]+20s 
D/Picasso: Hunter      executing    [R0]+20s, [R1]+20s, [R2]+20s 
D/Picasso: Dispatcher  retrying     [R0]+41s, [R1]+41s, [R2]+41s 
D/Picasso: Hunter      executing    [R0]+41s, [R1]+41s, [R2]+41s 
D/Picasso: Dispatcher  batched      [R0]+41s, [R1]+41s, [R2]+41s for error
D/Picasso: Dispatcher  delivered    [R0]+42s, [R1]+42s, [R2]+42s 
D/Picasso: Main        errored      [R0]+42s 
D/Picasso: Main        errored      [R1]+42s 
D/Picasso: Main        errored      [R2]+42s 

Я думаю, что ошибка в этой строке:

 W/System.err: remove failed: ENOENT (No such file or directory) : /data/data/com.example.ahmadi.khadamat/cache/picasso-cache/journal.tmp

работает на всех версиях Android, но не работает на Android 5.1.1 (планшет) (API 22)

1 Ответ

0 голосов
/ 17 мая 2018

добавить этот код:

.memoryPolicy(MemoryPolicy.NO_STORE)
.networkPolicy(NetworkPolicy.NO_STORE)
...