I’m trying to run `xcodebuild` from command line, ...
# kotlin-native
y
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
do you know if Gradle is ever started (i.e. with
jps -v
command)?
y
This is what is printed when i add this command to the shell script
Copy code
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
What if you will stop Gradle daemon?
y
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
Hard to tell… Does regular gradle build from same console work?
j
wich shell are you using ?
y
i’m using zsh
do you think that might be causing the problem?
o
Generally if you will try to debug Gradle build by adding
-i
option to gradlew command in the project
y
I’ve tried that and it prints
Initialized native services in: /Users/yusuf/.gradle/native
and then hangs
o
What if you will remove .gradle completely?
y
So i removed the .gradle folder, then ran xcodebuild again
it redownloaded gradle, and started the daemon:
Copy code
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
please create an issue on github/youtrack, so that we could discuss there, seems there’s not enough info at the moment
y
Okay i’ll make one now!
o
I have reproduced that locally, and
--no-daemon
flag to
gradlew
in the project file seems to fix the problem
y
Yes this works!
thankyou