Picasso: Picasso 3 & 2.71828: cannot access Source class file for okio.Source not found

Created on 18 Mar 2018  路  12Comments  路  Source: square/picasso

I get such error for line return new Result(bm, Picasso.LoadedFrom.DISK);

    private class VideoRequestHandler extends RequestHandler {

        @Override
        public boolean canHandleRequest(Request data) {
            return ("video".equals(data.uri.getScheme()));
        }

        @Override
        public Result load(Request data, int arg1) throws IOException {
            Bitmap bm = ThumbnailUtils.createVideoThumbnail(data.uri.getPath(), MediaStore.Images.Thumbnails.MINI_KIND);
            return new Result(bm, Picasso.LoadedFrom.DISK);
        }
    }

All 12 comments

seems new version of library is missing dependency implementation 'com.squareup.okio:okio:1.14.0'

I added but it didn't help..

actually same error with picasso 2.71828

only 2.5.2 works fine

Okio is a transitive dependency of OkHttp, for which there is a dependency present.

releaseRuntimeClasspath - Resolved configuration for runtime for variant: release
+--- com.squareup.okhttp3:okhttp:3.10.0
|    \--- com.squareup.okio:okio:1.14.0
+--- com.android.support:support-annotations:27.1.0
\--- com.android.support:exifinterface:27.1.0
     \--- com.android.support:support-annotations:27.1.0

And you can see these dependencies are correctly in the Maven pom: https://oss.sonatype.org/content/repositories/snapshots/com/squareup/picasso3/picasso/3.0.0-SNAPSHOT/picasso-3.0.0-20180314.141103-27.pom.

If you're using Gradle you can check your dependencies by running the dependencies task on the project. All signs point to this being a problem with your build configuration and not with Picasso itself so closing.

yes I didn't need to add it cause it was already resolved, no errors with import, but it still didn't work with 2.7 or 3 version, only 2.5.2 works.

try my code please before closing this issue, please!

it's a little different issue (not about resolving), but

cannot access Source class file

anyway 2.5.2 works fine, if you don't want to fix it then I'm ok with 2.5.2

Works locally for me. If your IDE cannot access the file then it's still a build system / IDE problem.

well I cloned from this git 2.5.2, 2.7 & 3 versions only 2.5.2 worked, there was no difference how I added every library to my project

ok I want to try it again but using remote library implementation 'com.squareup.picasso:picasso:2.71828'
but how can I do next mPicassoInstance = Picasso.with(mContext, new VideoRequestHandler());

for Picasso 2.7 or 3.*?

it has only get method (mPicassoInstance = Picasso.get()) with no parameters...

new Picasso.Builder().addRequestHandler(...)...build() and then reuse this Picasso instance.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JakeWharton picture JakeWharton  路  3Comments

austynmahoney picture austynmahoney  路  5Comments

ghost picture ghost  路  5Comments

StErMi picture StErMi  路  6Comments

ivanmagdic picture ivanmagdic  路  3Comments