java - 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");
解决方案
尝试更新到implementation "com.squareup.picasso:picasso:2.71828"
重复条目program type already present
只能来自另一个库或另一个模块。.jar
最有可能的是,目录中有一个不必要的毕加索,不能libs
删除。
推荐阅读
- sql - 如何将 SELECT a.*, b.* 中的列名自动重命名为 ie。结果列名中的前缀 a_ 和 b_?
- lodash - 如何使用 sortBy 使用 react datepicker 和 lodash
- javascript - 触发调度时保持内联样式更改?
- python - 我们可以编写 Cython 'cdef' 函数并在 cython 之外使用它们吗?
- java - Jackson 从 Class 创建 JavaType
- python - 给输入 x 和 n 只需要找到指数值
- oracle - 如何假脱机这个 pl/SQL 过程的结果
- node.js - 为什么我的服务器没有使用 npm run start:prod 运行?下面是 packgae.json 文件
- python - 物体占据图像一小部分的物体检测
- c - C:将参数从可变参数函数传递给可变参数宏