3

I have a custom gradle task (Exec type) which is responsible for running Python3 command and this task happens before the buildProcess. When i manually fire assembleDebug command via terminal, task works find and there a successful build. But when I manually click Build->Rebuild or Run->Run in Android Studio, there is following message.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:doSomething'.
> A problem occurred starting process 'command 'Python3''

Following is my gradle task

task doSomething(type:Exec){
    workingDir 'scripts'
    commandLine 'Python3','playGuitar.py'
}

preBuild.dependsOn(doSomething)

Any help or suggestions will be appreciated.

sam33r
  • 245
  • 2
  • 16
  • `task doSomething(type:Exec){ workingDir 'build' commandLine 'C:\\Python\\Python27\\python.exe','--help' }` <= works for me ... *:app:doSomething usage: C:\Python\Python27\python.exe [option] ... [-c cmd | -m mod | file | -] [arg]...* add Python3 to PATH or use full path – Selvin Dec 14 '15 at 20:39
  • @Selvin This is being used cross-platform, so I want to avoid having absolute paths in the `build.gradle`. How do I add directories to my path in Android Studio? The Path variables screen in preferences doesn't seem to work. – sam33r Dec 14 '15 at 20:44

0 Answers0