You can't import ViewPagerIndicator via
compile 'com.viewpagerindicator:library:2.4.0'
because that Maven artifact is just a jar of the Java library, but VPI relies on Android resources that aren't in the jar.
Maven artifacts that have AAR packaging do have resources and will work, but VPI isn't packaged that way. It has apklib packaging, but the Android Gradle plugin doesn't support that.
You'll need to download the source and set it up as an android-library module.
You weren't specific about what version of Android Studio you're running, but I'm willing to bet that your problem with the import not working is due to the fact that you're running something earlier than 0.4.3; bugs have been fixed in that area since then.