Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot build project

Tags:

android

gradle

I trying to assemble my project, but I only get an error:

Error:Execution failed for task ':basetools:processDebugAndroidTestResources'.
> No slave process to process jobs, aborting

I didn't change anything in my gradle files but abruptly got this error.

I already tried invalidate cahces and restart, rebuild

What should I do to fix it?

This is my project's build.gradle

buildscript {
    ext.kotlin_version = '1.1.51'
    apply from: 'scripts/dependencies.gradle'
    apply from: 'scripts/testDependencies.gradle'
    repositories {
        google()
        mavenLocal()
        jcenter()
        maven { url 'https://maven.fabric.io/public' }
        maven {
            url "https://maven.google.com"
        }
        maven { url 'https://jitpack.io' }
    }
    dependencies {
        classpath plugin.android
        classpath plugin.fabric
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:3.1.0'
    }
}

allprojects {
    repositories {
        google()
        mavenLocal()
        jcenter()
        maven { url 'https://maven.fabric.io/public' }
        maven {
            url "https://maven.google.com"
        }
        maven { url 'https://jitpack.io' }
    }
    gradle.projectsEvaluated {
        tasks.withType(JavaCompile) {
            options.compilerArgs << "-Xmaxerrs" << "1000" // or whatever number you want
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

This is a build.project of app

apply plugin: 'com.android.application'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'io.fabric'

def mainKeystore = file("../main.keystore")
//def debugKeystore = file("../debug.keystore")

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.2"
    defaultConfig {
        applicationId "com.ilyinp.valutetracker"
        minSdkVersion 19
        targetSdkVersion 26
        versionCode 2
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
        vectorDrawables.useSupportLibrary = true
    }

    signingConfigs {
        release {
            storeFile mainKeystore
            keyAlias "valutetracker"
        }
    }

    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }
    }

    dataBinding {
        enabled = true
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
        incremental = false
    }
}

kapt {
    generateStubs = true
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.google.firebase:firebase-core:11.6.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
    compile project(base.baseTools)
    compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
    kapt "com.android.databinding:compiler:3.0.0"

    compile dep.dagger.lib
    kapt dep.dagger.apt

    compile dep.moxy.lib
    compile dep.moxy.appCompat
    kapt dep.moxy.apt

    compile(dep.crashlytics) {
        transitive = true
    }
    compile 'com.google.android.gms:play-services-ads:11.6.0'
}

apply plugin: 'com.google.gms.google-services'

And finally, build.gradle of module basetools

apply plugin: 'com.android.library'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 26
    buildToolsVersion '26.0.2'


    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    dataBinding {
        enabled = true
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

kapt {
    generateStubs = true
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:26.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile dep.support.multiDex
    //    compile dep.support.appCompat
    compile dep.support.cardView
    compile dep.support.recyclerView
    compile dep.support.design
    compile dep.support.constraintLayout
    compile dep.glide.lib
    compile dep.glide.transformations
    compile dep.rxjava.lib
    compile dep.rxjava.android
    compile dep.rxjava.permissions
    compile dep.rxjava.binding
    compile dep.rxjava.bindingCompat
    compile dep.retrofit.lib
    compile dep.retrofit.converter.gson
    compile dep.retrofit.adapter.rxjava
    compile dep.okhttp.lib
    compile dep.okhttp.interceptor.logging
    compile dep.dagger.lib
    kapt dep.dagger.apt
    compile dep.timber
    compile dep.moxy.lib
    compile dep.moxy.appCompat
    kapt dep.moxy.apt
    compile dep.materialDialogs
    compile dep.parceler.lib
    kapt dep.parceler.apt
    compile dep.cicerone
    compile(dep.fastadapter) {
        transitive = true
    }
    compile(dep.fastadapterCommons)
    compile(dep.fastadapterExtensions)
    compile(dep.materialize) {
        transitive = true
    }
    compile(dep.crashlytics) {
        transitive = true
    }
    compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
    kapt "com.android.databinding:compiler:3.0.0"
}
repositories {
    mavenCentral()
}
like image 307
P. Ilyin Avatar asked Nov 12 '17 16:11

P. Ilyin


People also ask

How do you exclude a project from a build?

On the menu bar, choose Build > Configuration Manager. In the Project contexts table, locate the project you want to exclude from the build. In the Build column for the project, clear the check box. Choose the Close button, and then rebuild the solution.

What is the difference between build and clean build?

Build solution: Compiles code files (DLL and EXE) which are changed. Rebuild: Deletes all compiled files and compiles them again irrespective if the code has changed or not. Clean solution: Deletes all compiled files (DLL and EXE file).

What does build solution mean?

Build Solution - compiles code files (dll and exe) that have changed. Rebuild Solution - Deletes all compiled files and Compiles them again regardless of whether or not the code has changed.


1 Answers

Go to Android Studio, click "File" and click "Invalidate Caches / Restart...". This will work.

like image 146
Rajeev Sahu Avatar answered Nov 09 '22 11:11

Rajeev Sahu