26

I am getting this error, please help me.

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

Done so far :

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

i add these lines in build gradle file too. but same error coming. what shall i do now. please help me.

Could you please tell me how I add picasso library?

Kartiki
  • 265
  • 1
  • 3
  • 7

4 Answers4

52

Add this to your dependencies in build.gradle:

enter image description here

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

The latest version can be found here

Make sure you are connected to the Internet. When you sync Gradle, all related files will be added to your project

Take a look at your libraries folder, the library you just added should be in there.

enter image description here

Ramesh R
  • 7,009
  • 4
  • 25
  • 38
Ojonugwa Jude Ochalifu
  • 26,627
  • 26
  • 120
  • 132
  • i add that line but showing same error(i edited my post) – Kartiki Feb 19 '15 at 10:07
  • Hmm.Try rebuilding the project. – Ojonugwa Jude Ochalifu Feb 19 '15 at 10:16
  • yes. i rebuild it too,,, i dnt know what i done wrong – Kartiki Feb 19 '15 at 10:19
  • One more thing you could try, delete `include ':libs:picasso-master'` from your settings.gradle file,delete the file you created also and rebuild.Or if you are not far gone in your project, you can delete it and follow the new steps suggested to add a library project in build.gradle – Ojonugwa Jude Ochalifu Feb 19 '15 at 10:23
  • sorry,,,could you please tell me what are the step by steps to add the library. ok I will create new project too – Kartiki Feb 19 '15 at 10:26
  • The joy about using the method I and others gave you is that you don't have to go through any "steps" besides just copying and pasting `compile 'com.squareup.picasso:picasso:2.5.0'` in your build.gradle file and syncing your project.It's very simple.I advice you create a new project – Ojonugwa Jude Ochalifu Feb 19 '15 at 10:28
  • sorry again,,,then no need to add picasso lib (what i download is) – Kartiki Feb 19 '15 at 10:31
  • Yes, once you add the code to your dependecies and sync, you automatically install picasso.You do not need to create a lib folder or copy anything else. – Ojonugwa Jude Ochalifu Feb 19 '15 at 10:32
  • hey wow,,,, i created new project and add that line in build.gradle. now no errors. but how i know the picasso is added to my project. – Kartiki Feb 19 '15 at 10:38
  • Thank you ,,,,very much. My project also have that structure... thank you once again – Kartiki Feb 19 '15 at 10:52
  • When i add in the gradle compile 'com.squareup.picasso:picasso:2.71828' It didn't worked for me. May be latest version might not include all the classes. Version 2.5.0 worked for me. Thanks – gauravsngarg Apr 13 '18 at 13:09
23

easiest way to add dependence

hope this help you or Ctrl + Alt + Shift + S => select Dependencies tab and find what you need ( see my image)

Community
  • 1
  • 1
vuhung3990
  • 6,353
  • 1
  • 45
  • 44
  • @ meow meo What tool are you using to make the video of screen and then convert it to good quality and reasonable sized .gif ? (nice idea) – Mab Oct 04 '15 at 07:15
10

Add the Picasso library in Dependency

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

Sync The Project Create one imageview in 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>

Add the Internet permission in Manifest file

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

//Initialize ImageView

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

//Loading image from below url into imageView

Picasso.get()
   .load("YOUR IMAGE URL HERE")
   .into(imageView);
Ramesh R
  • 7,009
  • 4
  • 25
  • 38
Manikanta Reddy
  • 631
  • 9
  • 15
4

Dependency

dependencies {

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

}

//Java Code for Image Loading into imageView

Picasso.get().load(werURL).into(imageView);