调试失败摇篮建立在Android的工作室 [英] Debugging failed Gradle builds in Android studio

查看:148
本文介绍了调试失败摇篮建立在Android的工作室的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个任务,下面简单的生成配置:

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")
    }
}

这是Android的工作室,下面的错误运行时,在命令行中使用 gradle这个installDebug 运行时构建运行得很好,但失败:

The build runs just fine when run from the command line with gradle installDebug but fails when running from 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.

我如何传递的参数,如--stacktrace,从Android的工作室到摇篮,所以我可以调试为什么任务失败?

How can I pass the parameters, such as --stacktrace, from Android Studio to Gradle so I can debug why the task fails?

推荐答案

在OSX:Android的工作室 - > preferences - >编译器 - >摇篮 - >命令行选项

On OSX: Android Studio -> Preferences -> Compiler -> Gradle -> Command-line Options

这篇关于调试失败摇篮建立在Android的工作室的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆