My app is setup to build a generic main aar that is included in individual customer apps.
Previously the aar would appear at
/{library_name}/build/outputs/aar/core-release.aar
Here is the gradle file for the entire project
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
}
}
allprojects {
repositories {
jcenter()
maven {
credentials {
username ''
password ''
}
url 'https://artifactory.*.com/artifactory/*-libs/'
}
google()
}
}
Here is the gradle for the library that should be generating an aar
apply plugin: 'com.android.library'
dependencies {
implementation project(':AndroidAsync')
implementation project(':simplezxing')
implementation('org.apache.httpcomponents:httpmime:4.5.1') {
exclude module: "httpclient"
}
implementation 'net.danlew:android.joda:2.9.+'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.google.android.gms:play-services-location:9.0.2'
implementation 'com.google.android.gms:play-services-gcm:9.0.2'
implementation 'com.google.android.gms:play-services-maps:9.0.2'
implementation 'com.android.support:support-v13:25.3.0'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}
android {
compileSdkVersion 21
buildToolsVersion '26.0.2'
defaultConfig {
multiDexEnabled false
minSdkVersion 18
targetSdkVersion 21
versionCode 1604020110 //Last two digits are build type 0 = Developer, 1 = Development, and 5 rc and 10 for release
versionName "4.2.1"
}
signingConfigs {
debug {
storeFile file("keystores/debug.keystore")
}
release {
storeFile file("keystores/*-android.keystore")
storePassword ""
keyAlias ""
keyPassword ""
}
}
lintOptions {
abortOnError false
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
}
dexOptions {
jumboMode true
javaMaxHeapSize "4g"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
I did remove some company specific info.
The rest of my build is working fine on jenkins but the aar is just not present as expected.
edit
This builds the aar correctly when I build my jenkins by branch which uses
./gradlew clean build
If I build by product flavor it doesn't build the aar, this uses
./gradlew clean assemble{flavor}