Giorgi
07/08/2023, 3:41 PMld: framework not found XCTest
# A useful reference
# <https://github.com/JetBrains/kotlin/tree/master/kotlin-native/platformLibs/src/platform/ios>
language = Objective-C
package = platform.XCTest
depends = UIKit
modules = XCTest
# Specify the framework we want to link explicitly
linkerOpts = -framework XCTest
# Specify locations `-F` is a way to specify the search path.
# For more information on linker arguments
# <https://www.manpagez.com/man/1/ld/>
linkerOpts.ios_x64 = -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks
# The IDE might be showing red-squiggles here, but, this is a necessary parameter.
# Otherwise you will run into linker errors that look something like:
# ld: framework not found XCTest
linkerOpts.ios_simulator_arm64 = -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks
linkerOpts.ios_arm64 = -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/
compilerOpts= -framework XCTest -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/
compilations.getByName("main") { // NL
cinterops {
val xcTestInterop by creating {
defFile(project.file("src/nativeInterop/cinterop/xcTestInterop.def"))
// <https://youtrack.jetbrains.com/issue/KT-48807#focus=Comments-27-5210791.0-0>
compilerOpts("-DNS_FORMAT_ARGUMENT(A)=")
}
}
}
> Task :linkDebugExecutableNative FAILED
3 actionable tasks: 1 executed, 2 up-to-date
e: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld invocation reported errors
Please try to disable compiler caches and rerun the build. To disable compiler caches, add the following line to the gradle.properties file in the project's root directory:
kotlin.native.cacheKind.macosX64=none
Also, consider filing an issue with full Gradle log here: <https://kotl.in/issue>
The /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld command returned non-zero exit code: 1.
output:
ld: framework not found XCTest
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':linkDebugExecutableNative'.
> Compilation finished with errors
* 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>
BUILD FAILED in 1s
19:36:49: Execution finished 'runDebugExecutableNative'.
linkerOpts
but can not get it to work