Debugging Failed Gradle in Android Studio

I have the following simple build configuration with a task:

apply plugin: 'android'

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.0"

    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }

    task compileSass(type:Exec) {
        commandLine 'sass', "src/main/theme/default.scss", "src/main/assets/default.css"
    }

    project.afterEvaluate{
        preBuild.dependsOn("compileSass")
    }
}

The line runs just fine when launched from the command line using gradle installDebug, but does not work when working in Android Studio with the following error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':PixateTest:compileSass'.
> A problem occurred starting process 'command 'sass''

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

How do I pass options like -stacktrace from Android Studio to Gradle so that I can debug, why does the task not work?

+4
source share
2 answers

On OSX: Android Studio -> Settings -> Compiler -> Gradle -> Command Line Options

+8
source

File> Settings> Gradle> Gradle VM Settings.

, compileSass - , "sass" PATH.

+3

Source: https://habr.com/ru/post/1531909/


All Articles