Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android Android Tools Using Git for Android Using Git for Android

He Zhang
He Zhang
7,475 Points

when I use github to get the picasso project, it contains 3 folders. I try to compile it, but doesn't work.

when I use github to get the picasso project, it contains 3 folders. I try to compile it, but doesn't work. I then try to only open the picasso-sample folder, this time I add a compile configuration of android application manually by clicking the on the button next to the "green triangle". Then it says package R does not exist.

So i don't understand how to use the files we get from Github. It seems it is on different format. I couldn't even find the graddle build files at all

1 Answer

Hi He Zhang, if you want to use the Picasso library and you're using Android Studio, then you just have to add this compile 'com.squareup.picasso:picasso:2.5.2' in your build.gradle. This is how you let Gradle download the jars for you. so you'll have something like this:

dependencies {
    compile 'com.android.support:support-v4:19.1.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
}

https://github.com/square/picasso

Good luck ! :-)

He Zhang
He Zhang
7,475 Points

Thank you for answering. But I am confused about how to use the sample code, or how to improve the actual picasso project by first compiling it, not how to use it as a library. For example, I clone the files from the github folders, and then how do I run those codes?

Ah okay. I just looked here and this is the project you're looking for. you should know that, this is a Java library, so this isn't an Android porject so Android Studio won't build this, unless your creating something called a "library module" in Android Studio. check out this tutorial on how to create libraries for Android.