Подтвердить что ты не робот

Как добавить библиотеку picasso в андроид-студию

Я получаю эту ошибку, пожалуйста, помогите мне.

     Error:A problem occurred configuring project ':app'.
> Cannot evaluate module picasso-master : Configuration with name 'default' not found.

Готово:

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

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'
}

Я добавлю эти строки в файл build gradle. но такая же ошибка. что я буду делать сейчас. пожалуйста, помогите мне.

Не могли бы вы рассказать мне, как добавить библиотеку picasso?

4b9b3361

Ответ 1

Добавьте это к своим зависимостям в build.gradle:

enter image description here

dependencies {
 implementation 'com.squareup.picasso:picasso:2.71828'
  ...

Последнюю версию можно найти здесь here

Убедитесь, что вы подключены к Интернету. Когда вы синхронизируете Gradle, все связанные файлы будут добавлены в ваш проект

Посмотрите на папку с библиотеками, библиотека, которую вы только что добавили, должна быть там.

enter image description here

Ответ 2

easiest way to add dependence

надеюсь, что это поможет вам или Ctrl + Alt + Shift + S = > выберите вкладку "Зависимости" и найдите то, что вам нужно (см. мое изображение)

Ответ 3

Добавьте библиотеку Пикассо в Dependency

dependencies {
       ...
       implementation 'com.squareup.picasso:picasso:2.71828'
       ...
    }

Синхронизировать проект Создайте одно изображение в Layout

<ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/imageView"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true">
</ImageView>

Добавьте интернет-разрешение в файл манифеста

<uses-permission android:name="android.permission.INTERNET" />

//Инициализация ImageView

ImageView imageView = (ImageView) findViewById(R.id.imageView);

//Загрузка изображения из ссылки ниже в imageView

Picasso.get()
   .load("YOUR IMAGE URL HERE")
   .into(imageView);