How to create jar file from android project which contains facebook library and viewPager library in android studio
-
2stackoverflow.com/questions/24309950/… Check this oneTarun Sharma– Tarun Sharma2016-01-20 10:08:36 +00:00Commented Jan 20, 2016 at 10:08
-
stackoverflow.com/questions/27646262/…Tarun Sharma– Tarun Sharma2016-01-20 10:08:54 +00:00Commented Jan 20, 2016 at 10:08
Add a comment
|
1 Answer
Its working for me
- Enter your java source file
- alter your manifest file like as below
Manifest File:
apply plugin: 'com.android.library'
android
{
compileSdkVersion 23
buildToolsVersion "23.0.2"
useLibrary 'org.apache.http.legacy'
defaultConfig
{
minSdkVersion 15
targetSdkVersion 23
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile project(':facebook')
}
task deleteOldJar(type:Delete){
delete 'release/FacebookSharingApi.jar'
}
task exportJar(type:Copy){
from('build/intermediates/bundles/release/')
into('release/')
include('classes.jar')
rename('classes.jar','FacebookSharingApi.jar')
}
exportJar.dependsOn(deleteOldJar,build)
- Click the expostJar(Task) --- Follow below steps
> Right side of your android studio
> --- Gradle
--- Gradle project
--- click refresh button
--- app ---others -- (ExportJar)