It is currently in use by another Gradle instance

前端 未结 27 717
自闭症患者
自闭症患者 2020-12-04 08:14

I\'m new to Gradle build system. I want to do some basic functions on it. I\'m running/building it in command line. I am referring User guide. And, doing some simple tasks.<

相关标签:
27条回答
  • 2020-12-04 08:56

    I could be late but look like quick and efficient solution.

    Execute following steps.

    1. Execute ps -ef | grep gradle
    2. Open terminal and move to ~/.gradle/caches path
    3. Execute find ~/.gradle -type f -name "*.lock" | while read f; do rm $f; done

    It's done.

    0 讨论(0)
  • 2020-12-04 08:56

    I had same problem and i did two steps and it became solved.

    1. My JDK was not installed on Mac (i forgot to install) i installed it.
    2. I deleted all items from caches folder located in this path /Users/icon_developer/.gradle/ and rebuilt the project. It worked!
    0 讨论(0)
  • 2020-12-04 08:56

    To resolve this problem in windows

    1. Goto Task Manager
    2. Find the Owner PID in "details" of task manager
    3. End the task
    0 讨论(0)
  • 2020-12-04 08:57

    Have tried all this answers, including kill java process, delete .gradle in HOME_DIR and in project dir, restarted Android Studio, and even restarted OS.

    It started to work normally only after I launched gradle sync.

    0 讨论(0)
  • 2020-12-04 08:58

    In my case, just closed the Android Studio and reopened it, the problem solved.

    0 讨论(0)
  • 2020-12-04 08:59

    While killing the process and/or removing the lock file works, Gradle should be able to handle this on its own, solving the problem permanently. This problem report hints at the solution: Gradle cannot communicate with the gradle service.

    Have a look at your local network firewall. In my case,

    • allowing outbound traffic from 127.0.0.1 to 127.0.0.1,

      sudo iptables -A OUTPUT -p udp -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT
      
    • allowing incoming traffic from 127.0.0.1

      sudo iptables -A INPUT -s 127.0.0.1 -p udp -j ACCEPT
      

    solved the issue. A discussion of a similar problem at github.

    And, Please refer any link to improve my knowledge on Gradle Build system in Android.

    The udacity gradle course, if you have some time.

    0 讨论(0)
提交回复
热议问题