Error:Execution failed for task ':processDebugResources'. > Failed to execute aapt - android

I know there are very similar questions asked previously but before I make any drastic changes I thought I would post the question here first.
This is the error I'm getting.
My build.gradle is like this
android {
compileSdkVersion 27
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.microsoft.graph.helpdesk"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
multiDexEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/maven/com.google.guava/guava/pom.properties'
exclude 'META-INF/maven/com.google.guava/guava/pom.xml'
}
configurations {
all {
resolutionStrategy.force 'com.android.support:support-annotations:23.4.0'
}
}
defaultConfig {
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
defaultConfig {
vectorDrawables.useSupportLibrary = true
}
}
dependencies {
// Azure AD
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-core:11.8.0'
implementation 'com.android.support:support-vector-drawable:27.1.0'
implementation 'com.android.support:cardview-v7:27.1.0'
implementation 'com.google.android.gms:play-services-maps:11.8.0'
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.github.baoyachi:StepView:1.9'
implementation 'com.github.vipulasri:timelineview:1.0.6'
compile(project(':o365-auth'))
// Dagger compiler for DI annotation support
annotationProcessor 'com.squareup.dagger:dagger-compiler:1.2.5'
provided('com.squareup.dagger:dagger-compiler:1.2.5')
// Butterknife
annotationProcessor 'com.jakewharton:butterknife:6.1.0'
compile 'com.jakewharton:butterknife:6.1.0'
compile 'com.microsoft.graph:msgraph-sdk-android:1.1.0'
compile 'joda-time:joda-time:2.9.4'
compile 'com.google.guava:guava:19.0'
compile 'com.android.volley:volley:1.1.0-rc2'
compile 'com.android.support:design:27.0.2'
// Test libraries
androidTestCompile 'com.android.support:support-annotations:23.4.0'
//noinspection GradleCompatible
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2.2'
androidTestCompile 'com.android.support.test.espresso:espresso-web:2.2.2'
}
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
apply plugin: 'com.google.gms.google-services'
I have tried all the other solutions I could find but nothing has worked so far.
If anyone has any help at all it would be much appreciated
[EDIT] I have actually tried to run three other projects using API 27 and I am getting the same error.

at project ':o365-auth' that helped me to compile it;
try adal latest version or design instead appcompat etc
dependencies {
// compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
// Dependency injection
compile 'com.squareup.dagger:dagger:1.2.5'
provided 'com.squareup.dagger:dagger-compiler:1.2.5'
// Azure AD
compile 'com.microsoft.aad:adal:1.12.0'
}

compile(project(':o365-auth'))
have similar issues;
prev on 23 and 23.0.3 all work good
tried upper gradle but same issues on 25 too

Related

can not decralation place holder view

i had a problem in my gradelle with response Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve com.mindorks:placeholderview:0.7.1.
i try like
a. settings > build exception deployment > gradle > uncheck offline work it's failed
b. clean and reburd it's failed
c. invalidate and restart failed
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '26.0.2'
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "sid.len.mobile"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
multiDexEnabled true
}
packagingOptions {
pickFirst 'META-INF/LICENSE.txt' // picks the JavaMail license file
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
jcenter()
maven {
url "https://maven.java.net/content/groups/public/"
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:27.0.0'
implementation 'com.android.support:gridlayout-v7:27.0.0'
compile 'com.android.support:support-annotations:27.0.0'
implementation 'com.android.support:recyclerview-v7:27.0.0'
compile 'com.android.support:design:27.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
compile 'com.android.support:multidex:1.0.3'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.google.android.gms:play-services-location:11.0.1'
compile 'com.google.android.gms:play-services-maps:11.0.1'
compile 'com.google.android.gms:play-services-safetynet:11.0.1'
compile 'com.google.android.gms:play-services-base:11.0.1'
compile 'com.google.android.gms:play-services-basement:11.0.1'
compile 'com.google.android.gms:play-services-tasks:11.0.1'
compile 'net.zetetic:android-database-sqlcipher:3.4.0#aar'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.0'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup:otto:1.3.8'
//noinspection OutdatedLibrary
compile 'com.android.volley:volley:1.1.0'
compile files('libs/jtds-1.3.1.jar')
testCompile 'junit:junit:4.12'
compile 'com.mindorks:placeholderview:0.7.1'
}
you need to add this repository:
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
while that build.gradle seems to have more than one problem, including duplicate *.jar references and a few outdated libraries (in case you may wonder why it still won't build).
at least use buildToolsVersion "27.0.3".

firebaseUI dependency not matching with the firebase version 15.0.0

firebaseUI dependency not matching with the firebase version 15.0.0 Actually what is happening is that, when I include the firebaseUI dependency , android studio shows some kind of error related to values.xml file. I have linked the picture of error below and when I remove that line everything works fine , then there is no error.
The code for the entire gradle file is given below:
apply plugin: 'com.android.application'
repositories {
mavenLocal()
flatDir {
dirs 'libs'
}
maven { url "https://maven.google.com" }
}
android {
compileSdkVersion 24
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.google.firebase.udacity.friendlychat"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
resConfigs "en"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.google.firebase:firebase-database:15.0.0'
compile 'com.google.firebase:firebase-auth:15.0.0'
compile 'com.google.firebase:firebase-core:15.0.0'
compile 'com.firebaseui:firebase-ui-database:3.3.0'
compile 'com.android.support:design:24.2.0'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.github.bumptech.glide:glide:3.6.1'
}apply plugin: 'com.google.gms.google-services'
ERROR:
The README at FirebaseUI's github repo is quite clear. You need to explicitly override all the transitive dependencies for each UI library e.g if you are using firebase-ui-auth version 3.3.0 but want to use firebase version 15.0.0 and support libaries version 27.1.1, it will be be something like below.
implementation 'com.firebaseui:firebase-ui-auth:3.3.0'
implementation 'com.google.firebase:firebase-auth:15.0.0'
implementation 'com.google.android.gms:play-services-auth:15.0.0'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:customtabs:27.1.1'
implementation "com.android.support:cardview-v7:27.1.1"
implementation 'com.android.support:design:27.1.1'
Try updating your setup, also firebase UI is still depedning in version 12.0.1 not 15.0.0. See the docs to see which versions match with which firebase ui versions:
apply plugin: 'com.android.application'
repositories {
mavenLocal()
flatDir {
dirs 'libs'
}
maven { url "https://maven.google.com" }
}
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.google.firebase.udacity.friendlychat"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
resConfigs "en"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.google.firebase:firebase-database:12.0.1'
compile 'com.google.firebase:firebase-auth:12.0.1'
compile 'com.google.firebase:firebase-core:12.0.1'
compile 'com.firebaseui:firebase-ui-database:3.3.0'
compile 'com.android.support:design:27.1.1'
compile 'com.android.support:appcompat-v7:27.1.1'
compile 'com.github.bumptech.glide:glide:3.6.1'
}
apply plugin: 'com.google.gms.google-services'
whatever the Firebase UI dependency you want to use, try adding below two dependencies.
It worked for me, this might work for you as well
implementation "android.arch.core:runtime:1.1.1"
implementation "android.arch.core:common:1.1.1"

Gradle build fails on enabling data binding

i am facing a strange issue. I have decided to enable databinding in my project and in order to do so i followed the developer.android guidelines. So i added the dataBinding tag in my gradle file and gradle sync fails and shows the following error.
Error:java.lang.NullPointerException
Error:Execution failed for task ':app:mergeDebugResources'.
Error: java.lang.NullPointerException
and no other information is there so that i can track down the problem. My gradle file is below:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId '***.********.***'
minSdkVersion 19
targetSdkVersion 26
versionCode 76
versionName '4.8.3'
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
// Enabling multidex support.
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
//todo useLibrary is added agains LinkedInActivity which uses legacy http connection,
//should change it to different implementation
useLibrary 'org.apache.http.legacy'
dexOptions {
jumboMode true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
}
}
packagingOptions {
exclude 'build.xml'
exclude 'lib/getLibs.ps1'
exclude 'lib/getLibs.sh'
exclude 'lib/gson-2.2.2.jar'
}
dataBinding {
enabled = true
}
lintOptions {
disable 'MissingTranslation'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':library_fab')
implementation project(':library')
implementation project(':barcodeScannerLib')
implementation project(':cropper')
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2',
{
exclude group: 'com.android.support', module: 'support-annotations'
}
compile
('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.10.6#aar') {
transitive = true
}
implementation project(':libraryDatePicker')
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.code.gson:gson:2.3.1'
compile 'de.greenrobot:greendao:1.3.7'
compile 'com.loopj.android:android-async-http:1.4.9'
compile 'com.google.android.gms:play-services-gcm:8.3.0'
compile 'com.google.android.gms:play-services-plus:8.3.0'
compile 'com.google.android.gms:play-services-analytics:8.3.0'
compile 'com.facebook.android:facebook-android-sdk:4.8.0'
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support:design:26.0.1'
compile 'com.android.support:cardview-v7:26.0.1'
compile 'com.android.support:recyclerview-v7:26.0.1'
compile 'com.android.support:palette-v7:26.0.1'
compile 'com.android.support:support-v4:26.0.1'
compile 'com.github.amlcurran.showcaseview:library:5.4.3'
compile 'com.rengwuxian.materialedittext:library:2.1.4'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:exifinterface:26.0.1'
implementation project(':librarySweetAlertDialog')
}
apply plugin: 'com.google.gms.google-services'
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '25.4.0'
}
}
}
}
The problem with Databinding (and Dagger as well) is that, if there's an error, a lot of files are not generated, giving lots of errors. So much in fact, that the default output of javac is not enough to see the error message at the bottom.
Most of the time, it helps to increase the maximum number of error output lines, by adding this to your build.gradle
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xmaxerrs" << "1500"
}
}

No virtual methods newJsonReader(Ljava/io/Reader;) issue when generating build

I have been using retrofit2 along with Gson convertor in many applications. But currently I'm contributing to an existing project and i have used both dependencies. While running the project directly, it works perfectly. But whenever I generate a debug or release build, This error appears in Toast and Api content is not parsed.
Proguard is disabled. Here is the error:
No virtual method
newJsonReader(Ljava/io/Reader;)Lcom/google/gson/stream/JsonReader; in
class Lcom/google/gson/Gson; or its super classes (declaration of
'com.google.gson.Gson' appears in
/data/app/com."packagename"/base.apk:classes2.dex)
App Gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.medris.medrisemt.medrishcemt"
minSdkVersion 22
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
}
splits {
abi {
enable true
reset()
include 'x86', 'armeabi-v7a'
universalApk true
}
}
}
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':zoomsdk')
implementation project(':zoomcommonlib')
implementation project(':redirectionalgorithm');
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'io.jsonwebtoken:jjwt:0.9.0'
implementation 'com.squareup.okhttp:okhttp:2.7.5'
implementation 'commons-codec:commons-codec:1.9'
implementation 'com.android.support:appcompat-v7:25.4.0'
implementation 'com.android.support:design:25.4.0'
implementation 'com.android.support:support-v4:25.4.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'org.apache.httpcomponents:httpcore:4.4.1'
testImplementation 'junit:junit:4.12'
implementation 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
implementation 'com.squareup.okhttp3:okhttp:3.8.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.google.android.gms:play-services-maps:11.8.0'
implementation 'io.nlopez.smartlocation:library:3.3.3'
implementation 'com.google.android.gms:play-services:11.8.0'
}
apply plugin: 'com.google.gms.google-services'
I have searched for relevant answers but no satisfactory results. I have tried to downgrade the gson & retrofit dependencies but no success.
Update
I have updated the Gson & retrofit-convertor dependencies in the gradle code above to the one I was actually using initially. I mistakenly posted the downgraded ones that I tried for testing.
Try this,
I started using the newer versions:
compile 'com.google.code.gson:gson:2.7'
compile 'com.squareup.retrofit2:retrofit:2.2.0'
compile 'com.squareup.retrofit2:converter-gson:2.2.0'
And the error disappeared.
After adding this dependencies in your gradle file, please clean and
rebuild your project.
write this in build.gradle > these are newer versions
compile 'com.google.code.gson:gson:2.7'
compile 'com.squareup.retrofit2:retrofit:2.2.0'
compile 'com.squareup.retrofit2:converter-gson:2.2.0'

build takes very long time on API version 18

As long as I set the minSdkVersion to 21 everything is fine. But as soon as I set it to 18, the build takes like 18 minutes on my Macbook Pro (2016).
Especially transformClassesWithDexForFullDebug takes like forever.
my build gradle file:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'realm-android'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId “my.android.app”
//Todo: change to 18 for final export. Having minSdkVersion 21 reduces build time significantly
minSdkVersion 18
targetSdkVersion 25
versionCode 6
versionName "0.5.1"
testInstrumentationRunner "my.android.app.MockTestRunner"
setProperty("archivesBaseName", “MyApp-v$versionName")
multiDexEnabled true
// externalNativeBuild {
// ndk {
// abiFilters "armeabi-v7a", "x86"
// }
// }
}
sourceSets {
main {
jni.srcDirs = []
}
}
buildTypes {
debug{
// Disable fabric build ID generation for debug builds
ext.enableCrashlytics = false
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
demo {
applicationIdSuffix ".demo"
versionNameSuffix "-demo"
resValue "string", "app_name", “Appname Demo"
}
full {
resValue "string", "app_name", “Appname”
}
}
compileOptions{
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
splits {
abi {
enable true
reset()
include 'x86', 'armeabi-v7a'
universalApk false
}
}
// externalNativeBuild {
// ndkBuild {
// path "src/main/jni/Android.mk"
// }
// }
}
repositories {
maven {
url 'https://github.com/uPhyca/stetho-realm/raw/master/maven-repo'
}
maven{
url 'https://maven.fabric.io/public'
}
}
dependencies {
def supportLibVersion = '25.3.1'
def playServicesVersion = '10.0.1'
compile fileTree(dir: 'libs', include: ['*.jar'])
//Utils
compile 'com.jakewharton.timber:timber:4.5.1'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
// Because RxAndroid releases are few and far between, it is recommended you also
// explicitly depend on RxJava's latest version for bug fixes and new features.
compile 'io.reactivex.rxjava2:rxjava:2.0.9'
compile 'com.jakewharton.rxbinding2:rxbinding:2.0.0'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.birbit:android-priority-jobqueue:2.0.1'
compile "com.google.android.gms:play-services-gcm:$playServicesVersion"
compile "com.google.android.gms:play-services-vision:$playServicesVersion"
//UI
compile "com.android.support:support-dynamic-animation:$supportLibVersion"
compile "com.android.support:appcompat-v7:$supportLibVersion"
compile "com.android.support:design:$supportLibVersion"
compile "com.android.support:recyclerview-v7:$supportLibVersion"
compile 'io.realm:android-adapters:2.0.0'
compile 'com.commit451:PhotoView:1.2.5'
compile 'com.squareup.picasso:picasso:2.5.2'
//Used to create Picasso instance wrapping a custom OkHttp client for testing
compile 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
//API calls
compile 'com.squareup.retrofit2:retrofit:2.2.0'
compile 'com.squareup.retrofit2:converter-gson:2.2.0'
compile 'com.squareup.retrofit2:adapter-rxjava2:2.2.0'
compile 'com.squareup.okhttp3:okhttp:3.4.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.0'
//Views injection
compile 'com.jakewharton:butterknife:8.5.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
compile "com.android.support:support-annotations:$supportLibVersion"
//Analytics
compile "com.mixpanel.android:mixpanel-android:5.+"
compile "com.google.android.gms:play-services:$playServicesVersion"
//Crash reporting
compile('com.crashlytics.sdk.android:crashlytics:2.6.8#aar') {
transitive = true;
}
//Debug database
debugCompile 'com.facebook.stetho:stetho:1.5.0'
debugCompile 'com.uphyca:stetho_realm:2.0.0'
//Testing
androidTestCompile "com.android.support:support-annotations:$supportLibVersion"
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
//For recyclerview actions
androidTestCompile('com.android.support.test.espresso:espresso-contrib:2.2') {
// Necessary to avoid version conflicts
exclude group: 'com.android.support', module: 'appcompat'
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.android.support', module: 'support-annotations'
exclude module: 'recyclerview-v7'
}
testCompile 'junit:junit:4.12'
//Mockito and other dependencies to mock api calls
androidTestCompile 'org.mockito:mockito-core:2.0.2-beta'
androidTestCompile "com.crittercism.dexmaker:dexmaker:1.4"
androidTestCompile "com.crittercism.dexmaker:dexmaker-mockito:1.4"
androidTestCompile "com.crittercism.dexmaker:dexmaker-dx:1.4"
//Library that allows waiting for retrofit calls with espresso
androidTestCompile ('com.jakewharton.espresso:okhttp3-idling-resource:1.0.0'){
exclude module: 'okhttp'
}
androidTestCompile 'com.android.support.test:runner:0.5'
// Set this dependency to use JUnit 4 rules
androidTestCompile 'com.android.support.test:rules:0.5'
// Set this dependency to build and run Espresso tests
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
// Set this dependency to build and run UI Automator tests
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
androidTestCompile 'com.linkedin.testbutler:test-butler-library:1.3.1'
}
I am looking for a way to bring down the compilation time to max 5 minutes. My guess is that it would help a lot if I could figure out what transformClassesWithDexForFullDebug actually really does on a granular level, which would allow me to remove those library dependencies which are causing this insane build time. Any ideas?
This is a common problem and the reason why many developers use minSdkVersion 21 for debug builds. I myself have two productFlavors, one with minSdkVersion 15 and one with 21. I use the one with minSdkVersion 21 for my day-to-day work, because it builds so much faster than API 15. 18 minutes is extreme though, what is your build time on API 21?
See also: https://developer.android.com/studio/build/optimize-your-build.html
"When developing your app, you should deploy to a device running Android 7.0 (API level 24) or higher whenever possible."
I managed to bring down build time to 2.5 minutes by removing all directories inside ~/.gradle/
rm -rf ~/.gradle/

Categories

Resources