3

我有一个自定义 gradle 任务(Exec 类型),它负责运行 Python3 命令,并且此任务发生在 buildProcess 之前。当我通过终端手动触发 assembleDebug 命令时,找到任务工作并成功构建。但是当我在 Android Studio 中手动单击 Build->Rebuild 或 Run->Run 时,会出现以下消息。

FAILURE: Build failed with an exception.

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

以下是我的毕业任务

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

preBuild.dependsOn(doSomething)

任何帮助或建议将不胜感激。

4

0 回答 0