https://kotlinlang.org logo
Title
y

yusuf3000

05/31/2018, 1:34 PM
I’m trying to run
xcodebuild
from command line, and i have a shell script in my project that runs gradlew :
"$SRCROOT/../../../gradlew"
. If i build from xcode, it works completely fine, but if i do it from command line then the operation hangs on this line indefinitely. Does anyone know why this would be happening?
o

olonho

05/31/2018, 1:57 PM
do you know if Gradle is ever started (i.e. with
jps -v
command)?
y

yusuf3000

05/31/2018, 2:05 PM
This is what is printed when i add this command to the shell script
832  -Xms256m -Xmx1280m -XX:ReservedCodeCacheSize=240m -XX:+UseCompressedOops -Dfile.encoding=UTF-8 -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -Dsun.io.useCanonCaches=false -Djava.net.preferIPv4Stack=true -Djna.nosys=true -Djna.boot.library.path= -da -Xverify:none -XX:ErrorFile=/Users/yusuf/java_error_in_studio_%p.log -XX:HeapDumpPath=/Users/yusuf/java_error_in_studio.hprof -Xbootclasspath/a:../lib/boot.jar -Djb.vmOptionsFile=/Applications/Android Studio.app/Contents/bin/studio.vmoptions -Didea.java.redist=Bundled -Didea.home.path=/Applications/Android Studio.app/Contents -Didea.executable=studio -Didea.platform.prefix=AndroidStudio -Didea.paths.selector=AndroidStudio3.1
33505 KotlinCompileDaemon -Djava.awt.headless=true -Djava.rmi.server.hostname=127.0.0.1 -Xmx1024m -Dkotlin.environment.keepalive
37347 Jps -Dapplication.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home -Xms8m
22036 GradleDaemon -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant
o

olonho

05/31/2018, 2:06 PM
What if you will stop Gradle daemon?
y

yusuf3000

05/31/2018, 2:08 PM
How do i go about doing that?
If i add
gradle --stop
then it says no gradle daemons are running
and its still suspended
o

olonho

05/31/2018, 4:11 PM
Hard to tell… Does regular gradle build from same console work?
j

james

05/31/2018, 6:56 PM
wich shell are you using ?
y

yusuf3000

06/03/2018, 7:47 AM
i’m using zsh
do you think that might be causing the problem?
o

olonho

06/03/2018, 7:58 AM
Generally if you will try to debug Gradle build by adding
-i
option to gradlew command in the project
y

yusuf3000

06/03/2018, 8:08 AM
I’ve tried that and it prints
Initialized native services in: /Users/yusuf/.gradle/native
and then hangs
o

olonho

06/03/2018, 8:21 AM
What if you will remove .gradle completely?
y

yusuf3000

06/03/2018, 8:43 AM
So i removed the .gradle folder, then ran xcodebuild again
it redownloaded gradle, and started the daemon:
Successfully started process 'Gradle build daemon'
An attempt to start the daemon took 0.744 secs.
and then it hangs
but it got further than it did the last time
If i run
./gradlew build
from terminal, then it doesn’t hang. But I can’t see why xcode running the same command hangs
o

olonho

06/03/2018, 11:36 AM
please create an issue on github/youtrack, so that we could discuss there, seems there’s not enough info at the moment
y

yusuf3000

06/03/2018, 11:39 AM
Okay i’ll make one now!
o

olonho

06/03/2018, 7:33 PM
I have reproduced that locally, and
--no-daemon
flag to
gradlew
in the project file seems to fix the problem
y

yusuf3000

06/04/2018, 9:02 AM
Yes this works!
thankyou