Run JUnit tests in Android studio - android-studio

I created new Android Project and tried to run tests (JUnit) and had follow result:
15:28:53: Executing external tasks 'cleanTest test --tests com.binomv.rimidalv.tt.*'...
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'TT'.
Could not resolve all dependencies for configuration ':classpath'.
Artifact 'kxml2.jar (net.sf.kxml:kxml2:2.3.0)' not found.
Searched in the following locations:
https://jcenter.bintray.com/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0.jar
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 0.512 secs
Artifact 'kxml2.jar (net.sf.kxml:kxml2:2.3.0)' not found.
Searched in the following locations:
https://jcenter.bintray.com/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0.jar
But if i use test through device - it is ok.
Thank you.
-----UPDATE-----
build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.binomv.rimidalv.tt"
minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.android.support:support-v4:22.0.0'
}
----- SOLUTION -----
You should remove "~/.gradle" folder. Android Studio recreate it.

Related

How do I resolve this ProductFlavours error

This is the first time I've used Android Studio and I can't build this app.
Can anyone tell me how to fix this code?
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "org.settingsdeployer"
minSdkVersion 15
targetSdkVersion 21
versionCode 4
versionName "1.2"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
normal {
applicationId "org.settingsdeployer"
versionCode 4
versionName "1.2"
}
french {
applicationId "org.settingsdeployer"
versionCode 5
versionName "1.2_fr"
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
}
I'm getting these errors when it tries to sync:
ERROR: All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com/r/tools/flavorDimensions-missing-error-message.html
Affected Modules: org.settingsdeployer
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Affected Modules: org.settingsdeployer
I made the requested changes and it sync'd but now I can't make an apk:
That's great, it sync'd the build without errors but now when I try to generate an apk i get more errors. I have no idea what I'm doing!
UPDATE:
After adding flavorDimensions it sync'd the build without errors but now when I try to generate an apk i get more errors. I have no idea what I'm doing!. Here is the error log:
Executing tasks: [:org.settingsdeployer:assembleNormalRelease]
Task :org.settingsdeployer:preBuild UP-TO-DATE Task :org.settingsdeployer:preNormalReleaseBuild UP-TO-DATE Task :org.settingsdeployer:compileNormalReleaseAidl NO-SOURCE Task :org.settingsdeployer:compileNormalReleaseRenderscript UP-TO-DATE Task :org.settingsdeployer:checkNormalReleaseManifest UP-TO-DATE Task :org.settingsdeployer:generateNormalReleaseBuildConfig UP-TO-DATE Task :org.settingsdeployer:prepareLintJar UP-TO-DATE Task :org.settingsdeployer:generateNormalReleaseSources UP-TO-DATE Task :org.settingsdeployer:javaPreCompileNormalRelease UP-TO-DATE Task :org.settingsdeployer:mainApkListPersistenceNormalRelease Task :org.settingsdeployer:generateNormalReleaseResValues UP-TO-DATE Task :org.settingsdeployer:generateNormalReleaseResources UP-TO-DATE Task :org.settingsdeployer:mergeNormalReleaseResources FAILED
FAILURE: Build failed with an exception.
What went wrong: Could not resolve all files for configuration ':org.settingsdeployer:_internal_aapt2_binary'.
Could not find com.android.tools.build:aapt2:3.3.1-5013011. Searched in the following locations:
file:/C:/Users/Stuart/AppData/Local/Android/Sdk/extras/m2repository/com/android/tools/build/aapt2/3.3.1-5013011/aapt2-3.3.1-5013011.pom
file:/C:/Users/Stuart/AppData/Local/Android/Sdk/extras/m2repository/com/android/tools/build/aapt2/3.3.1-5013011/aapt2-3.3.1-5013011-windows.jar
file:/C:/Users/Stuart/AppData/Local/Android/Sdk/extras/google/m2repository/com/android/tools/build/aapt2/3.3.1-5013011/aapt2-3.3.1-5013011.pom
file:/C:/Users/Stuart/AppData/Local/Android/Sdk/extras/google/m2repository/com/android/tools/build/aapt2/3.3.1-5013011/aapt2-3.3.1-5013011-windows.jar
file:/C:/Users/Stuart/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/tools/build/aapt2/3.3.1-5013011/aapt2-3.3.1-5013011.pom
file:/C:/Users/Stuart/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/tools/build/aapt2/3.3.1-5013011/aapt2-3.3.1-5013011-windows.jar
https://jcenter.bintray.com/com/android/tools/build/aapt2/3.3.1-5013011/aapt2-3.3.1-5013011.pom
https://jcenter.bintray.com/com/android/tools/build/aapt2/3.3.1-5013011/aapt2-3.3.1-5013011-windows.jar Required by: project :org.settingsdeployer
Try: Run with --info or --debug option to get more log output. Run with --scan to get full insights.
I'm getting these errors when it tries to sync: ERROR: All flavors
must now belong to a named flavor dimension. Learn more at
https://d.android.com/r/tools/flavorDimensions-missing-error-message.html
Affected Modules: org.settingsdeployer
The flavor dimension problem is happened because you haven't add the flavorDimensions to your build.gradle. There must be at least one flavorDimensions. Something like this:
android {
...
defaultConfig {...}
buildTypes {
debug{...}
release{...}
}
// you need to specifies one flavor dimension.
flavorDimensions "version"
productFlavors {
normal {
// This property is optional if you are using only one dimension.
dimension "version"
applicationId "org.settingsdeployer"
versionCode 4
versionName "1.2"
}
french {
dimension "version"
applicationId "org.settingsdeployer"
versionCode 5
versionName "1.2_fr"
}
}
}
more details at Configure build variants
WARNING: Configuration 'compile' is obsolete and has been replaced
with 'implementation' and 'api'. It will be removed at the end of
2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Affected Modules: org.settingsdeployer
This warning is telling that we need to use either api or implementation to replace the compilation when adding dependencies. So, change the dependencies block to something like this;
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:21.0.3'
}

Elasticsearch Java High Level Client Dependency refuse to work with Gradle

I am having trouble with dependencies for Elasticsearch High Level Java Client 6.2.2 in Android Studio 3.0.
I have alot of duplicate files in my META-INF directory and sub-directories. I've tried using packagingOptions, doesn't work. Other things that doesn't work
Using default compiler instead of D8
Use older version of Gradle.
Turned off instant run.
Advanced profiling is not on.
Invalidate/manually delete cache.
my app/libs is empty.
I can't exclude group: 'org.apache.httpcomponents', module: 'httpclient' because I'm using the client.
The only thing that will get the app to run is change implementation 'org.elastic... to compileOnly. But this means I cant call the functions at run time.
I am new to android and this is driving me nuts. Should I start poking around in libraries folder .idea\libraries and changing some of these paths? Could this be where the problem is?
Here is the Gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com. .myapplication"
minSdkVersion 26
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.test.InstrumentationTestRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
testOptions {
unitTests.returnDefaultValues = true
}
buildToolsVersion '26.0.2'
productFlavors {
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-
core:3.0.1'
implementation 'org.elasticsearch.client:elasticsearch-rest-high-level-
client:6.2.2'
annotationProcessor 'org.apache.logging.log4j:log4j-core:2.9.1'
}
This is the error I'm currently getting. With bad formating
Error:com.android.builder.dexing.DexArchiveBuilderException:
Failed to process C:\Users\mmmmmm\.gradle\caches\modules-2\files-
2.1\org.elasticsearch\elasticsearch\6.2.2\16b3f7a7a31b89144723eb85c0583234842f68
4\elasticsearch-6.2.2.jar
Error:com.android.builder.dexing.DexArchiveBuilderException:
java.lang.RuntimeException: java.lang.IllegalArgumentException
Error:java.lang.RuntimeException: java.lang.IllegalArgumentException
Error:java.lang.IllegalArgumentException
Error:Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
> com.android.build.api.transform.TransformException:
com.android.builder.dexing.DexArchiveBuilderException:
com.android.builder.dexing.DexArchiveBuilderException: Failed to process
C:\Users\mmmmm\.gradle\caches\modules-2\files-
2.1\org.elasticsearch\elasticsearch\6.2.2\16b3f7a7a31b89144723eb85c0583234842f684\elasticsearch-6.2.2.jar

Error Android Studio:No dex files created while using Google's Calendar API

apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion '24.0.1'
defaultConfig {
applicationId "com.example.calendarquickstart"
minSdkVersion 11
targetSdkVersion 24
versionCode 1
multiDexEnabled true
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.google.android.gms:play-services-auth:9.4.0'
compile 'pub.devrel:easypermissions:0.1.5'
compile('com.google.api-client:google-api-client-android:1.22.0') {
exclude group: 'org.apache.httpcomponents'
}
compile('com.google.apis:google-api-services-calendar:v3-rev210-1.22.0') {
exclude group: 'org.apache.httpcomponents'
}
}
I am trying to use google API for calendar but I am getting following error while running the app"
Information:Gradle tasks [:app:clean, :app:generateDebugSources,
:app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies,
:app:generateDebugAndroidTestSources, :app:assembleDebug]
Error:Execution failed for task
':app:transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: No dex files
created at
C:\Users\user\AndroidStudioProjects\CalendarQuickstart\app\build\intermediates\transforms\dex\debug\folders\1000\10\guava-jdk5-17.0_bbc68f1b67df2c58337cd00757b7bfd105bb5573"
I am following the steps from this link
What changes need to be done in gradle file for running this app?
Try enabling the multidex support in your build.gradle file as stated in Configuring Your App for Multidex with Gradle:
android {
compileSdkVersion 21
buildToolsVersion "21.1.0"
defaultConfig {
...
minSdkVersion 14
targetSdkVersion 21
...
// Enabling multidex support.
multiDexEnabled true
}
...
}
dependencies {
compile 'com.android.support:multidex:1.0.0'
}
Additional reading:
Android application (APK) files contain executable bytecode files in the form of Dalvik Executable (DEX) files, which contain the compiled code used to run your app. The Dalvik Executable specification limits the total number of methods that can be referenced within a single DEX file to 65,536—including Android framework methods, library methods, and methods in your own code. In the context of computer science, the term Kilo, K, denotes 1024 (or 2^10). Because 65,536 is equal to 64 X 1024, this limit is referred to as the '64K reference limit'.
Getting past this limit requires that you configure your app build process to generate more than one DEX file, known as a multidex configuration.

Android Studio :Null pointer exception when assembleDebugUnitTest gradle task is run

I am trying to run a simple JUNIT test for a test class in android studio. Build goes fine. When i try to run the JUNIT test i get the following error
*
Execution failed for task ':app:mockableAndroidJar'.
> java.lang.NullPointerException (no error message)
*
When i dumped the stacktrace i get the following. I am clueless as to why this is happening.
:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:mockableAndroidJar'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteAc
tionsTaskExecuter.java:69)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTa
skExecuter.java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecu
tionAnalysisTaskExecuter.java:35)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskEx
ecuter.java:64)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecut
er.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptyS
ourceFilesTaskExecuter.java:42)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithN
oActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecut
er.java:53)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMost
OnceTaskExecuter.java:43)
at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:31
0)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(Abst
ractTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(Abst
ractTaskPlanExecutor.java:63)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTask
PlanExecutor.java:51)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java
:23)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.ja
va:88)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:3
7)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:68)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:55)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:14
9)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessB
uildActionExecuter.java:90)
at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.
java:28)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.
java:41)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.
java:28)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSugges
tingBuildActionExecuter.java:50)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSugges
tingBuildActionExecuter.java:27)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:40)
at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:169)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineAct
ionFactory.java:237)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineAct
ionFactory.java:210)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.jav
a:35)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.jav
a:24)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFacto
ry.java:206)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFacto
ry.java:169)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.Main.doAction(Main.java:33)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:33)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: java.lang.NullPointerException
at org.objectweb.asm.MethodWriter.visitMaxs(Unknown Source)
at org.objectweb.asm.tree.MethodNode.accept(Unknown Source)
at org.objectweb.asm.tree.MethodNode.accept(Unknown Source)
at org.objectweb.asm.tree.ClassNode.accept(Unknown Source)
at com.android.builder.testing.MockableJarGenerator.rewriteClass(MockableJarGenerator.java:134
)
at com.android.builder.testing.MockableJarGenerator.createMockableJar(MockableJarGenerator.jav
a:91)
at com.android.build.gradle.internal.tasks.MockableAndroidJarTask.createMockableJar(MockableAn
droidJarTask.groovy:50)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAct
ion.doExecute(AnnotationProcessingTaskFactory.java:226)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAct
ion.execute(AnnotationProcessingTaskFactory.java:219)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAct
ion.execute(AnnotationProcessingTaskFactory.java:208)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:589)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:572)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteAct
ionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteAc
tionsTaskExecuter.java:61)
... 49 more
Test Environment used:
Environment: 1.2.2
SDK Version : API 21
Build tools 22.0.1
Android Plugin version : 1.2.3
Gradle version : 2.5
JDK : 1.7.0_79
Can you please help me out with this? Is there any problem with my setup?
Build Gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.example.krishnaswamyna.testmathsapplication"
minSdkVersion 21
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:recyclerview-v7:22.2.1'
compile 'com.android.support:leanback-v17:22.2.1'
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:2.0.31-beta'
testCompile 'org.robolectric:robolectric:3.0'
}
Jus delete the .gradle file in the project
I also had the same issue since a couple of weeks. I saw a hint about the issue being about the SDK from here.
What worked for me was to simply remove the SDK through the SDK Manager and then reinstalling it. You might also have to clean the project and/or invalidate cashes and restart Android Studio, between removing and reinstalling the SDK.
I had the same problem when i installed the Android Studio 2.0.
Uncheck Enable all test artifacts in:
File-> Settings-> Build, Execution, Deployement->Build Tools ->
Gradle-> Experimental gradle
Info: link
Clean the build and rebuild the app this might work and fix the issue. This gradle errors might come due to some old edited files just do the above said.

Running gradle with options in Android Studio [duplicate]

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 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.
How can I pass the parameters, such as --stacktrace, from Android Studio to Gradle so I can debug why the task fails?
On OSX: Android Studio -> Preferences -> Compiler -> Gradle -> Command-line Options
File > Settings > Gradle > Gradle VM options.
I suspect you're failing compileSass because of "sass" not being on PATH.

Resources