Earlier I have used android gradle plugin v2.2.2, now I am migrating to 3.0. The below code publishes(uploadArchives task) all my variants to maven without any issues with 2.14.1. But as soon I upgrade to 3.0 nothing is been published. If I remove the prodcutFlavors, it publishes the release version of the library to maven properly. Am I missing something? Is something changed in 3.0?
I have read that by default now all variants will be published and publishNonDefault is no more needed. After removing publishNonDefault also it does not work.
I am using Gradle 4.1 with plugin 3.0 & Gradle 2.14.1 with plugin 2.2.2
apply plugin: 'com.android.library'
apply plugin: 'maven'
android {
compileSdkVersion 26
defaultConfig {
minSdkVersion 17
targetSdkVersion 26
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
publishNonDefault true
flavorDimensions "app"
productFlavors{
apple{
}
orange{
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
uploadArchives {
repositories {
mavenDeployer {
repository(url: mavenLocal().url)
pom.version = "1.3.7"
pom.artifactId = "android"
pom.groupId = "com.example"
}
}
}