Kar*_*iki 20 android android-studio picasso
我收到此错误,请帮帮我.
Error:A problem occurred configuring project ':app'.
> Cannot evaluate module picasso-master : Configuration with name 'default' not found.
Run Code Online (Sandbox Code Playgroud)
到目前为止:
1. download the picaso
2.unzip the zip folder
3.Under project section created one directory called as lib and add the unzip file
4. In settings-gradle
include ':app'
include ':libs:picasso-master'
wrote these lines.
5. after that in project structure module dependency add the picasso library
6. rebuild and clean
Run Code Online (Sandbox Code Playgroud)
7.
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:21.0.3'
compile project(':library:picasso-master')
compile 'com.squareup.picasso:picasso:2.5.0'
}
Run Code Online (Sandbox Code Playgroud)
我也在构建gradle文件中添加这些行.但同样的错误来了.我现在该怎么办 请帮我.
你能告诉我如何添加毕加索图书馆吗?
ojo*_*ifu 46
将此添加到您的依赖项中build.gradle:

dependencies {
implementation 'com.squareup.picasso:picasso:2.71828'
...
Run Code Online (Sandbox Code Playgroud)
或这个:
dependencies {
implementation 'com.squareup.picasso:picasso:2.71828'
...
Run Code Online (Sandbox Code Playgroud)
最新版本可以在这里找到
确保已连接到Internet.同步gradle时,所有相关文件都将添加到项目中
看看你的库文件夹,你刚刚添加的库应该在那里.

在Dependency中添加picasso库
dependencies {
...
implementation 'com.squareup.picasso:picasso:2.71828'
...
}
Run Code Online (Sandbox Code Playgroud)
同步项目在布局中创建一个图像视图
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageView"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true">
</ImageView>
Run Code Online (Sandbox Code Playgroud)
在Manifest文件中添加Internet权限
<uses-permission android:name="android.permission.INTERNET" />
Run Code Online (Sandbox Code Playgroud)
//初始化ImageView
ImageView imageView = (ImageView) findViewById(R.id.imageView);
Run Code Online (Sandbox Code Playgroud)
//将图片从url下方加载到imageView中
Picasso.get()
.load("YOUR IMAGE URL HERE")
.into(imageView);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
83114 次 |
| 最近记录: |