3

I just started using Android Studio and I would like to add an open source library to my project. I looked a lot over the internet, but I couldn't find a way to make my project compile and to make the library's classes visible.

This is the library I would like to include: https://github.com/TangoAgency/material-intro-screen?utm_source=android-arsenal.com&utm_medium=referral&utm_campaign=4368

On the readme it says as the first thing to add a gradle dependency:

dependencies {
   compile 'agency.tango.android:material-intro-screen:{latest_release}'
}

But it seems to me that there is something more to do before that... It's just I don't know what.

Beriol
  • 646
  • 1
  • 10
  • 25
  • Just add that to gradle and rebuild your project. You should be able to use it – rafaelc Feb 12 '17 at 18:25
  • 3
    Well, if nothing else, you need to replace `{latest_release}` with an actual version number. For whatever reason, they do not publish that in the project `README`. Based on a Google search, [0.0.5 appears to be the latest at the present time](https://bintray.com/tangoagency/maven/material-intro-screen). – CommonsWare Feb 12 '17 at 18:26
  • just add that to your app build.gradle file (not the project-level one) – Ali Bdeir Feb 12 '17 at 18:27

3 Answers3

6

You were doing it correctly, except one thing.

Replace,

compile 'agency.tango.android:material-intro-screen:{latest_release}'

with

compile 'agency.tango.android:material-intro-screen:0.0.5'

The latest available version for this library is 0.0.5 and you need to replace the placeholder with that value. Just put this new line instead of the old one in your build.gradle file and rebuild the project.

Aritra Roy
  • 15,355
  • 10
  • 73
  • 107
  • I'm an idioi, thanks, now it compiles. But still I don't understand how to make the classes of the library visible from my app. I know that it's probably stupid, but I don't know where to look for – Beriol Feb 12 '17 at 18:37
  • The library and all its files are already included. Just make any Activity and extend MaterialIntroActivity. Once you start typing the name MaterialIntroActivity, the IDE will show you automatic suggestions. – Aritra Roy Feb 12 '17 at 18:39
  • I tried, but it doesn't... I don't know what I'm doing wrong here – Beriol Feb 12 '17 at 18:41
  • Have you rebuild your project? Go to Build then click on Rebuild Project. – Aritra Roy Feb 12 '17 at 18:42
  • Sure thing, I tried that but still no luck. EDIT: wait a minute, I commented the dependency line, closed android studio, opened it again, uncommented the line and rebuilt. Now it finds the class. Don't know what happened there, but thanks for the help! – Beriol Feb 12 '17 at 18:44
  • I just tried compiling the library in my project and it worked fine. All I can say it, remove this line from build.gradle, close the IDE, open the IDE again, paste this line again in the build.gradle file, clean the project and rebuild it again. See if it works, otherwise you are doing something wrong. – Aritra Roy Feb 12 '17 at 18:49
1

See the latest version from this address:

Maven Center

Jcenter

Kazem Maleki
  • 179
  • 3
  • 6
0

Add this line to gradle file:

compile 'agency.tango.android:material-intro-screen:0.0.3'
EM-Creations
  • 4,195
  • 4
  • 40
  • 56
Hamid Nadi
  • 131
  • 1
  • 10