Gradle Could not create service of type InitScriptHandler using BuildScopeServices.createInitScriptHandler()

后端 未结 22 1883
囚心锁ツ
囚心锁ツ 2020-12-05 03:39

I used gradle build command in Centos 7 terminal and I got output:

FAILURE: Build failed with an exception.

* What we         


        
相关标签:
22条回答
  • 2020-12-05 04:26

    If you using wrapper gradlew, in root make directory .gradle_new

    mkdir .gradle_new
    chmod -R 777 .gradle_new
    

    and run gradlew with arguments:

    --project-cache-dir .gradle_new
    
    0 讨论(0)
  • 2020-12-05 04:26

    Restarting the machine solved the issue.

    0 讨论(0)
  • 2020-12-05 04:27

    This can happen if you run Gradle commands from separate terminals at the same time - I assume Gradle somehow locks ~/.gradle when it is running to prevent any problems.

    0 讨论(0)
  • 2020-12-05 04:28

    I had that same error, while running gradle with java 14 (openjdk) as my default java implementation. Setting default java back to java 8 solved the issue

    sudo update-alternatives --auto java
    
    0 讨论(0)
  • 2020-12-05 04:29

    In my case I had bad credentials to private Maven repository. JIdea does not show the inner exception but running gradle build reveals the problem immediately.

    0 讨论(0)
  • 2020-12-05 04:30

    I got this error when running code in IntelliJ Idea, and

    gradle --stop

    really not helped, as it said that "No Gradle daemons are running."

    But simple kill of all gradle processes helped:

    ps aux | grep gradle
    kill -9 $PID
    
    0 讨论(0)
提交回复
热议问题