I would like to build my app client side compatible with both Facebook Android SDK 3.x and 4.x since Facebook Android SDK deprecated "Session" class.
How can I write the build.gradle to create one aar file for v3.x and one for v4.x.
Thanks.
You can use flavors.
Just define your flavors in the build.gradle
android {
....
productFlavors {
flavorSdk3 {
...
}
flavorSdk4 {
...
}
}
}
Then you can use different dependencies for your flavors:
dependencies {
flavorSdk3Compile "..."
flavorSdk4Compile "..."
}