I am facing problem to use external library project's in android studio version 1.2.2 .
steps i did to add external library projects are:-
I created a new project exPagerSliding.
I Add a new directory(libs) in root directory of the app. and paste the library there.
I open my apps setting.gradle. and add following lines of code
include ':app' ':PagerSlidingTabStrip' project(':PagerSlidingTabStrip').projectDir=new File('libs/PagerSlidingTabStrip')then I open my build.gradle file add following lines of code
dependencies { classpath 'com.android.tools.build:gradle:1.2.3' compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:21.0.3' compile project(":PagerSlidingTabStrip") }
5.Next i go to gradle.properties and write following lines of code.
ANDROID_BUILD_MIN_SDK_VERSION=14
ANDROID_BUILD_TARGET_SDK_VERSION=21
ANDROID_BUILD_TOOLS_VERSION=21.1.3
ANDROID_BUILD_SDK_VERSION=21
and last in build.gradle i add
android {
compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION) buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION
defaultConfig { minSdkVersion Integer.parseInt(project.ANDROID_BUILD_MIN_SDK_VERSION) targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION) }}
I am getting a message "Error:Cannot get property ':PagerSlidingTabStrip' on null object"
When i open my build.gradle file from library . their i am getting this message
you must use a newer version of android gradle plugin.current version is 1.0 and recomended version is 1.2.3
well now problem is solved,
so i am writing for those who was still facing this mess.
step's to use external library project in android studio are:-
go to file-new -import module.
select your library project folder.
after importing module.
go to file->project structure->select app ->select dependency-> click on + sign in right side->module dependencies-> select your module name and press ok.
4th step was the final step , but you can get two type of error. Ex. no such property GROUP... for handle this go to select build.gradle of your library , and remove line like this apply from:
'https://raw.github.com/twotoasters/gradle-mvn-push/master/gradle-mvn-push.gradle'