Kotlin-native: BUILDING:error occurred when building the source with gradle

Created on 12 Aug 2019  路  11Comments  路  Source: JetBrains/kotlin-native

I'm sorry if this problem already solved ...

Overview

I caught the problem about building the Kotlin/Native source.

The thing I did

After cloning the source, I execute ./gradew dependencies:update (this succeeded) and ./gradew bundle (this failed).

Error details

The error message I caught is below :

> Task :Interop:Indexer:compileKotlin
Could not perform incremental compilation: Could not connect to Kotlin compile daemon
Could not connect to kotlin daemon. Using fallback strategy.
Interop/Indexer/src/main/kotlin/org/jetbrains/kotlin/native/interop/indexer/Utils.kt:192:9: info: 'when' expression on sealed classes is recommended to be exhaustive, add 'is IncompleteField' branch or 'else' branch instead
        when (it) {
        ^

> Task :common:ios_arm32Hash FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':common:ios_arm32Hash'.
> org.jetbrains.kotlin.konan.KonanExternalToolFailure: The /usr/bin/xcrun command returned non-zero exit code: 1.
  output:

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.5/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 2m 16s

I want to solve this problem, but I don't know well about the source.
Please tell me how to handle.

All 11 comments

Hello! Can you tell me, what version of the compiler are you trying to build? It looks like you are using some very recent tag, please try to checkout another one, for example, the release(v1.3.1).

Thank you for being sure.
Is this the answer you want...? (I don't kwon how to check compiler version) :

v1.3.1

I cloned the latest version in this repository today, so I think I have the latest source that is opened.

org.jetbrains.kotlin.konan.KonanExternalToolFailure: The /usr/bin/xcrun command returned non-zero exit code: 1.

It is possible that you don't have Xcode installed and properly configured.

What does output the following command?

xcrun --sdk iphoneos --show-sdk-path

Oh... maybe I don鈥檛 have Xcode.
Because I left the company and don鈥檛 have the machine now, I鈥檒l try that tomorrow.
Thank you for your advice.

I tried your advice. Surely my machine did not have the right path, so I executed below :

$ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/

And I got this :

macxxxx:~ yyyy$ xcrun --sdk iphoneos --show-sdk-path
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk

Because I set the appropriate path, I tried building.
But, again I caught another exception.

> Task :platformLibs:compileKonanIos_arm32-CommonCryptoIos_arm32 FAILED
Exception in thread "main" java.lang.Error: /var/folders/h5/y3j9_5xj6x3ggz3v9yc49fpm0qrf55/T/tmp8981846075029298079.m:1:9: fatal error: module 'CommonCrypto' not found
        at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:146)
        at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesASTFiles(ModuleSupport.kt:67)
        at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesInfo(ModuleSupport.kt:13)
        at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.buildNativeLibrary(main.kt:358)
        at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:219)
        at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:38)
        at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:65)
        at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:18)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':platformLibs:compileKonanIos_arm32-CommonCryptoIos_arm32'.
> A failure occurred while executing shadow.org.jetbrains.kotlin.gradle.plugin.tasks.KonanInteropTask$RunTool
   > Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1

Maybe I can resolve this by googling, but I report these exceptions and processes.

Please update to newer Xcode version.

Hello @simonNozaki . I think this page can help you.
Link: https://github.com/JetBrains/kotlin-native/issues/1919

I think you will need to check for the MacOS equivalent of the mentioned library.

Thanks! : @ANONYMOUS-HUMANOID-DEVELOPER

I checked! Hmm...

@simonNozaki can you confirm that using Xcode 10.0 fixes the problem?
"the mentioned library" tinfo is irrelevant here.

@SvyatoslavScherbina
Okay, now I am building the source, so again I tell you the result of building.

Successfully builded!
Thanks!
In this time, I upgraded Xcode version from 9.4 to 10.1, and MacOS version is High Sierra 10.13.

Because I builded the source successfully, I close this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nvlizlo picture nvlizlo  路  4Comments

Cortlandd picture Cortlandd  路  4Comments

msink picture msink  路  4Comments

antanas-arvasevicius picture antanas-arvasevicius  路  4Comments

msink picture msink  路  4Comments