0

I have added "viewpagerindicator" library and "com.android.support:gridlayout-v7:21.0.0" as a dependance in my project . Both of them has declare 'orientation' attribute
in 'viewpagerindicator' library its written -

<declare-styleable name="CirclePageIndicator">
        <attr name="android:orientation"> 
    </declare-styleable>

I am getting the above error how I can resolve this.

nitesh goel
  • 6,338
  • 2
  • 29
  • 38
  • 1
    try inherit orientation property using parent. – Haresh Chhelana Nov 27 '14 at 11:20
  • 1
    You will probably need to fork and modify the relevant ViewPagerIndicator library classes and resources to rename the attribute to `vpi_orientation` or some such. – CommonsWare Nov 27 '14 at 12:04
  • @CommonsWare : Thanks for replying.But I am not able to redefine . how can I change this "android:orientation" as it seems that it is using the default android orientation. Please explain with an example. – nitesh goel Dec 01 '14 at 12:51
  • @HareshChhelana : can you please give an example. As I have tried but not able to do it. :( – nitesh goel Dec 01 '14 at 12:52
  • which is top most parent library viewpagerindicator or com.android.support:gridlayout-v7:21.0.0? – Haresh Chhelana Dec 01 '14 at 13:09
  • @HareshChhelana: They are not related to each other. I am using both of them in my project for different purposes. – nitesh goel Dec 01 '14 at 13:17
  • Can you show us how do you actually use this attribute? Looks like you are not using it right. – Sean Dec 07 '14 at 21:14
  • I am not using this attribute.I want to add these two libraries as a dependency in my project. – nitesh goel Dec 08 '14 at 13:30
  • @niteshgoel: I don't think that you can have such error just because of using both library at a time. Even though if you insist, you may remove the line ` ` and check if it works fine for your app. – Mehul Joisar Dec 10 '14 at 12:08

2 Answers2

0

Try to use at build.gradle

compile 'fr.baloomba:viewpagerindicator:2.4.2'

See more details at http://mvnrepository.com/artifact/fr.baloomba/viewpagerindicator/2.4.2

gio
  • 4,950
  • 3
  • 32
  • 46
  • how it is different from the original one? – nitesh goel Dec 05 '14 at 06:41
  • according https://github.com/baloomba/Android-ViewPagerIndicator there was added gradle implementation. I tried to build empty project with your 2 dependencies at Android Stuiod . 2.4.1 gained error, 2.4.2 did not. – gio Dec 05 '14 at 09:07
  • still not working getting the same error . /build/intermediates/exploded-aar/fr.baloomba/viewpagerindicator/2.4.2/res/values/values.xml Error:Attribute "orientation" has already been defined – nitesh goel Dec 08 '14 at 13:29
  • Looks like you need to provide more details here, version of used AS, full version of your `build.gradle` and output from `gradlew androidDependencies` command. – gio Dec 08 '14 at 16:55
  • I guess that won't work .Today I updated my AS. Still getting the same error. – nitesh goel Dec 09 '14 at 14:13
0

With this .gradle build successfully for me

apply plugin: 'com.android.application'

android {
compileSdkVersion 21
buildToolsVersion "21.1.1"

defaultConfig {
    applicationId "com.cooperbros.myapplication"
    minSdkVersion 9
    targetSdkVersion 21
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
  }
}   

dependencies {

  compile fileTree(dir: 'libs', include: ['*.jar'])
  compile 'com.android.support:appcompat-v7:21.0.2'
  compile 'com.android.support:gridlayout-v7:21.0.0'
  compile 'fr.baloomba:viewpagerindicator:2.4.2'

}
Stanislav Bondar
  • 6,056
  • 2
  • 34
  • 46