Many people, developing applications for Android, use ViewPagerIndicator library. It's nice and open-sourced (you can clone or fork sources at GitHub). But after Google introduced Gradle build system in Android Studio, that can resolve dependencies through maven central repository we all very lack of AAR packaged version of that library - it's published in maven central, but in other pakaging (jar, apklib, etc.), that can not be properly used by gradle. However, author of ViewPagerIndicator, Jake Wharton doesn't hurry to publish aar packaging. But our developer, Serge Populov already built and published ViewPagerIndicator AAR package for public use.
To add dependency to ViewPagerIndicator AAR:
To add dependency to ViewPagerIndicator AAR:
- In your build.gradle include http://dl.bintray.com/populov/maven as repository priorior to mavenCentral:
repositories {
maven { url "http://dl.bintray.com/populov/maven" }
mavenCentral()
}
- Use in your dependencies as usual:
dependencies {
compile 'com.viewpagerindicator:library:2.4.1@aar'
}
Why priorior to mavenCentral?
Otherwise gradle will look first in mavenCentral, find viewpagerindicator artifact with the same version, but won't find aar package and will report an error, without looking for same artifact with another packaging in other repositories.
Otherwise gradle will look first in mavenCentral, find viewpagerindicator artifact with the same version, but won't find aar package and will report an error, without looking for same artifact with another packaging in other repositories.
I'd love to use this, but android studio gives me this:
ReplyDeleteGradle: A problem occurred configuring project ':FlashNotifier'.
> Failed to notify project evaluation listener.
> Could not download artifact 'com.viewpagerindicator:library:2.4.1@aar'
> Artifact 'com.viewpagerindicator:library:2.4.1@aar' not found.
that worked! Thanks for your help, accidentally put the url in the wrong repositories block
ReplyDeleteI'm glad to help!
ReplyDeletehi Serge, sorry for disturbing!
ReplyDeleteI am 10 years experienced Eclipse user, but now i am the newest Android Studio newbie of the world... I´ve never worked with gradle before and now i am fighting to import external libs in AS...
The point is as i see you have published viewpagerindicator as AAR and i got no problem following your step above, gradle has runned successfully. But, my first way to test a lib is now really in the classpath is to try to Ctrl+Shift+T it and type a know class in the dialog. I am trying to find "com.viewpagerindicator.TitlePageIndicator" for example but AS does not find it at all.
Any comment, helps, tips?
Thank you for helping the community in these issues!
Marcello Ribeiro
If I'm not mistaken, Ctrl+Shift+T is a shortcut for running tests (in default shortcuts layout)? It lists existing unit tests for current class, so, VPI classes won't be listed there. You should be able to use class VPI in autocompetes and navigating to class (Ctrl+N) after the first successfull build - does it work?
ReplyDeleteWonderful job my friend. I could import your version of VPI and make it work successfully. Will you maintain this repo for a long time?
ReplyDeleteI guess the official VPI author will finish uploading a version to the official maven central, but... For the moment we all depend on you! :-)
The repository will be available as long as JFrog maintains existance of Bintray.
ReplyDeleteSorry, I have some problem like picture.
ReplyDeleteWhat steps do I have to miss?
Take your pick from tons of of amazing slots, desk games, different actual money on line casino games to play with the most effective on line casino bonuses in Michigan. Remember to use the promotional code if you make a deposit. The on line casino provides bonus money to your 1xbet account based on sort of|the type of} offer. Since playing is concerned, not everybody may have winnings after finishing the wagering requirement.
ReplyDelete