nerses
04/22/2020, 10:39 PM23:30:05: Executing tasks ':assemble :macosMainBinaries :macosTestBinaries --stacktrace'...
> Configure project :
Kotlin Multiplatform Projects are an experimental feature.
> Task :cinteropLibcurlMacos FAILED
xcrun: error: unable to find utility "xcodebuild", not a developer tool or in PATH
Exception in thread "main" org.jetbrains.kotlin.konan.MissingXcodeException: An error occurred during an xcrun execution. Make sure that Xcode and its command line tools are properly installed.
at org.jetbrains.kotlin.konan.target.CurrentXcode.xcrun(Xcode.kt:77)
at org.jetbrains.kotlin.konan.target.CurrentXcode.access$xcrun(Xcode.kt:45)
at org.jetbrains.kotlin.konan.target.CurrentXcode$version$2.invoke(Xcode.kt:70)
at org.jetbrains.kotlin.konan.target.CurrentXcode$version$2.invoke(Xcode.kt:45)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at org.jetbrains.kotlin.konan.target.CurrentXcode.getVersion(Xcode.kt)
at org.jetbrains.kotlin.konan.target.AppleConfigurablesImpl$xcodePartsProvider$2.invoke(Apple.kt:71)
at org.jetbrains.kotlin.konan.target.AppleConfigurablesImpl$xcodePartsProvider$2.invoke(Apple.kt:24)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at org.jetbrains.kotlin.konan.target.AppleConfigurablesImpl.getXcodePartsProvider(Apple.kt)
at org.jetbrains.kotlin.konan.target.AppleConfigurablesImpl.getAbsoluteTargetToolchain(Apple.kt:48)
at org.jetbrains.kotlin.konan.target.ClangArgs.getAbsoluteTargetToolchain(ClangArgs.kt)
at org.jetbrains.kotlin.konan.target.ClangArgs.<init>(ClangArgs.kt:351)
at org.jetbrains.kotlin.konan.target.Platform$clang$2.invoke(Platform.kt:25)
at org.jetbrains.kotlin.konan.target.Platform$clang$2.invoke(Platform.kt:21)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at org.jetbrains.kotlin.konan.target.Platform.getClang(Platform.kt)
at org.jetbrains.kotlin.native.interop.tool.ToolConfig.<init>(ToolConfig.kt:37)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.prepareTool(main.kt:377)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:181)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:46)
at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:44)
at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:19)
at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:37)
Caused by: org.jetbrains.kotlin.konan.KonanExternalToolFailure: The /usr/bin/xcrun command returned non-zero exit code: 72.
output:
at org.jetbrains.kotlin.konan.exec.Command.handleExitCode(ExecuteCommand.kt:111)
at org.jetbrains.kotlin.konan.exec.Command.getResult(ExecuteCommand.kt:100)
at org.jetbrains.kotlin.konan.exec.Command.getOutputLines(ExecuteCommand.kt:79)
at org.jetbrains.kotlin.konan.exec.Command.getOutputLines$default(ExecuteCommand.kt:78)
at org.jetbrains.kotlin.konan.target.CurrentXcode.xcrun(Xcode.kt:75)
... 23 more
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':cinteropLibcurlMacos'.
> Process 'command '/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
I am confused as i can’t see anywhere in the docs Xcode as prerequisite.kevin.cianfarini
04/22/2020, 11:19 PMgabin
04/23/2020, 4:57 PMbasher
04/23/2020, 10:01 PMJamie Craane
04/24/2020, 7:47 AMroot
android
app (Android application)
common (multiplatform module (common code, iOS, Android and JVM)
buildSrc (some custom Gradle tasks)
iosApp (The iOS application)
jvmmodule (The JVM module, this is were it is all about)
localization (some custom localization code for Android and iOS)
The project is utilizing Kotlin 1.3.72 and Gradle 6.3.
When checking out and importing the project into the IDE (Android Studio or IntelliJ) the problem is replicated by doing the following:
Scenario 1 (running from the IDE)
Actual:
- Open the MyMainClass and click the Play icon in the gutter to execute the main method
- The run window of the IDE outputs “Exception in thread “main” java.lang.NoClassDefFoundError: nl/jamiecraane/nativestarter/api/MockApi”
Expected:
- The main method is excuted and the response from the MockApi is displayed in the console
Scenario 2 (running from Gradle)
For this, we configured the Gradle application plugin to execute the MyMainClassKt. Run the following command from the command line: ./gradlew :jvmmodule:run
The result of this execution is the following (as expected, without a NoClassDefFoundError)
> Task :jvmmodule:run
Hello
Response data: [Person(firstName=Jan, lastName=Janssen), Person(firstName=John, lastName=Smith)]
What can be the reason for this issue (NoClassDefFoundError when running the MyMainClass from the IDE instead of Gradle)?salomonbrys
04/24/2020, 9:26 AMSam Garfinkel
04/24/2020, 1:31 PMnerses
04/24/2020, 4:44 PMtypedef struct rd_kafka_message_s {
...
void *payload; /**< Producer: original message payload.
* Consumer: Depends on the value of \c err :
* - \c err==0: Message payload.
* - \c err!=0: Error string */
size_t len; /**< Depends on the value of \c err :
* - \c err==0: Message payload length
* - \c err!=0: Error string length */
...
} rd_kafka_message_t;
I am struggling to figure out how to read the payload to a bytearray from Kotlin
the interop binding gives me
public final var payload: kotlinx.cinterop.COpaquePointer? /* = kotlinx.cinterop.CPointer<out kotlinx.cinterop.CPointed>? */
public final var len: platform.posix.size_t /* = kotlin.ULong */
Alexander Larsson
04/24/2020, 4:54 PMDaniel Berg
04/25/2020, 8:21 PMrusshwolf
04/26/2020, 1:10 AMJeff Beyond
04/26/2020, 7:00 AMJeff Beyond
04/26/2020, 12:23 PMivan.savytskyi
04/27/2020, 4:57 AMList<SomeType?>
is translated to objectiveC / Swift as [Any]
. @kpgalligan as far as I remember you were working on adding generics support, could you please advise?Patrick
04/27/2020, 9:42 AMJeff Beyond
04/27/2020, 2:38 PMRostislav Utrobin
04/28/2020, 4:23 AMPatrick
04/28/2020, 7:39 AMAlexander Larsson
04/28/2020, 1:43 PMCFStringRefVar
to a Kotlin String
?Omar Mainegra
04/28/2020, 8:25 PMcos
function in K/N, i.e:
@Test
fun cosine_functions_works_the_same_in_all_platform() {
assertEquals(0.6441559905471732, cos(0.8708769899641021))
}
This test pass in JVM and JS, but fails in iOS:
kotlin.AssertionError: Expected <0.6441559905471732>, actual <0.6441559905471733>.
napperley
04/28/2020, 10:20 PMJeff Beyond
04/29/2020, 10:24 AMProduced library API in libkn_xxx_api.h
e: /home/jeff/.konan/dependencies/clang-llvm-8.0.0-linux-x86-64/bin/ld.lld invocation reported errors
The /home/jeff/.konan/dependencies/clang-llvm-8.0.0-linux-x86-64/bin/ld.lld command returned non-zero exit code: 1.
output:
ld.lld: error: unable to find library -lcurl
Task :effectmanager:linkDebugSharedLinuxX64 FAILED
FAILURE: Build failed with an exception.
Anyone who knows how to solve it?akapanina
04/29/2020, 12:03 PMPrateek Grover
04/29/2020, 5:49 PMe: Cannot access class 'kotlin.Pair'. Check your module classpath for missing or conflicting dependencies
e: Cannot access class 'kotlinx.coroutines.CoroutineExceptionHandler'. Check your module classpath for missing or conflicting dependencies
e: Cannot access class 'kotlin.collections.HashMap'. Check your module classpath for missing or conflicting dependencies
Omar Mainegra
04/29/2020, 8:15 PMsleep
without success)
@Test
fun `This test doesn't execute the println statement`() {
dispatch_async(dispatch_get_main_queue()) {
println("dispatch_async")
}
NSThread.sleepForTimeInterval(1.0)
}
I'm thinking about something similar to XCTestExpectation
. Any thoughts?Prateek Grover
04/29/2020, 9:55 PMe: Cannot access class 'kotlinx.coroutines.CoroutineExceptionHandler'. Check your module classpath for missing or conflicting dependencies
I have created a small reproducible project with two branches. master that does not build and gives an error and working-old-version that builds successful.
The only difference between the two branches is the versions of libs.
https://github.com/kerry/kn-multilib
To run the build
SDK_NAME=iphoneos-hello ./gradlew :analytics:build
Can someone help?napperley
04/30/2020, 1:00 AMKavan
04/30/2020, 4:22 AMval s1 = "hello"
var s2 = s1
And can anyone explain data race conditions in Kotlin ?
Is there brief explanation what's going on under the hoodmikehearn
04/30/2020, 9:38 AMld
? that's a common trick for deleting unused code. It basically removes symbols that have no references from other symbolsmikehearn
04/30/2020, 9:38 AMmikehearn
04/30/2020, 9:38 AMnapperley
05/01/2020, 1:58 AMmikehearn
05/13/2020, 2:41 PM