码迷,mamicode.com
首页 > 移动开发 > 详细

导入github ViewPagerIndicator 项目到 android studio

时间:2015-04-16 12:41:55      阅读:237      评论:0      收藏:0      [点我收藏+]

标签:

Top Level Build.gradle:

buildscript {
    repositories {
        maven { url "http://dl.bintray.com/populov/maven" }
        mavenCentral()
    }
    dependencies {
        classpath ‘com.android.tools.build:gradle:0.12.+‘
    }
}

allprojects {
    repositories {
        maven { url "http://dl.bintray.com/populov/maven" }
        mavenCentral()
    }
}

App‘s build.gradle:

compile ‘com.viewpagerindicator:library:2.4.1@aar‘

To use Android-ViewPagerIndicator in Android Studio, you can’t download it from gradle. Instead, you must import the library as an “Existing Project” to your current one.

Follow these steps:

  • 1 Download source code from GitHub.

  • 2 In your Android Studio Project: File -> Project Structure -> add (+ symbol) -> Import Existing Project. Import just the folder called ”library”, not the entire project (leave the import options as Android Studio suggests).

  • 3 If the “compileSdkVersion” specified in your build.gradle doesn’t match with the one specified in the Android-ViewPagerIndicator project, change the second one. The same apply with any other property, such as “minSdkVersion” or even the current support library.直接将App‘s build.gradle里面的android{}内容复制到新导入的模块的build.gradle中

  • 4 Add Android-ViewPagerIndicator project as a dependency to your build.gradle module:

    dependencies {
    compile project(‘:library‘)
    }
    
  • 5 Sync project with gradle files.

导入github ViewPagerIndicator 项目到 android studio

标签:

原文地址:http://my.oschina.net/sldk/blog/402262

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!