首页 > 解决方案 > Android Picasso different errors

问题描述

I am trying to get image from web and put it into ImageView, but Picasso keeps showing errors.. when I refresh androidStudio, it shows another errors.. I looked up for solutions, but there is no relevant up-to-date post anywhere. If anyone has any idea how to solve it, please comment.

Error: Program type already present: com.squareup.picasso.Action
Error: Program type already present: 
com.squareup.picasso.Callback$EmptyCallback

Dependencies:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint- 
layout:1.1.3'
    implementation 'com.android.support:design:28.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 
'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.squareup.picasso:picasso:2.5.2'
}

Picasso:

Picasso.with(About.this).load(photo).into(myImageView, new Callback() {
        @Override public void onSuccess() {
            Log.d("Debug", "Picasso Success");
        }

        @Override public void onError() {
            Log.d("Debug", "Picasso Errored");
        }
    });

String photo:

 String photo = getIntent().getExtras().getString("photo");

标签: javaandroidpicasso

解决方案


尝试更新到implementation "com.squareup.picasso:picasso:2.71828"

重复条目program type already present只能来自另一个库或另一个模块。.jar最有可能的是,目录中有一个不必要的毕加索,不能libs删除。


推荐阅读