Comments (6)
You can compile the native swift module to the exact build by running, if you are running on real device,
./gradlew swiftklibNativeModuleIosArm64
If it's simulator
./gradlew swiftklibNativeModeuleIosSimulatorArm64
Task names might be different, check all tasks using
./gradlew :shared:tasks --all
Might not be a exact fix, but seems like it's not getting compiled in the build - so have to do it separately.
Hope this might help.
from swift-klib-plugin.
Full output:
> Task :composeApp:swiftklibHelloSwiftIosSimulatorArm64 FAILED
error: 'swiftbuild': Invalid manifest (compiled with: ["/Applications/Xcode-14.3.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc", "-vfsoverlay", "/var/folders/p9/3bx5r6fx0_3grq0pp4rzkqnm0000gn/T/TemporaryDirectory.0vVABL/vfs.yaml", "-L", "/Applications/Xcode-14.3.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/ManifestAPI", "-lPackageDescription", "-Xlinker", "-rpath", "-Xlinker", "/Applications/Xcode-14.3.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/ManifestAPI", "-target", "arm64-apple-macosx12.0", "-sdk", "/Applications/Xcode-14.3.0.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk", "-F", "/Applications/Xcode-14.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks", "-I", "/Applications/Xcode-14.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib", "-L", "/Applications/Xcode-14.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib", "-swift-version", "5", "-I", "/Applications/Xcode-14.3.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/ManifestAPI", "-sdk", "/Applications/Xcode-14.3.0.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk", "-package-description-version", "5.5.0", "{removed}/composeApp/build/swiftklib/HelloSwift/iosSimulatorArm64/swiftBuild/Package.swift", "-Xfrontend", "-disable-implicit-concurrency-module-import", "-Xfrontend", "-disable-implicit-string-processing-module-import", "-o", "/var/folders/p9/3bx5r6fx0_3grq0pp4rzkqnm0000gn/T/TemporaryDirectory.zdr69v/swiftbuild-manifest"])
<unknown>:0: warning: using sysroot for 'iPhoneSimulator' but targeting 'MacOSX'
<unknown>:0: error: unable to load standard library for target 'arm64-apple-macosx12.0'
error: Process 'command 'xcrun'' finished with non-zero exit value 1
from swift-klib-plugin.
Worth mentioning that it is possible to use swift build
to build iOS targets.
https://forums.swift.org/t/use-swiftpm-to-build-ios-target/25436/13
For instance I can build my local swift package
mt@mt-imac MyLibrary % xcrun swift build -c release --arch arm64 -Xswiftc -sdk -Xswiftc `xcrun --sdk iphonesimulator --show-sdk-path` -Xswiftc -target -Xswiftc arm64-apple-ios11.0-simulator
Building for production...
Build complete! (0.15s)
Which imports UIKit
:
import UIKit
public struct MyLibrary {
public private(set) var text = "Hello, World!"
public init() {
}
}
from swift-klib-plugin.
Here's my Target Configuration:
kotlin {
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach { iosTarget ->
iosTarget.compilations {
val main by getting {
cinterops {
create("HelloSwift")
}
}
}
iosTarget.binaries.framework {
baseName = "ComposeApp"
isStatic = true
}
}
from swift-klib-plugin.
seems I can get it to build if I try setting a high number for minMacos
minMacos = 99
and only defining the iosSimulatorArm64
:
kotlin {
listOf(
iosSimulatorArm64()
).forEach { iosTarget ->
which works when syncing gradle.
however it appears to fail again when attempting to build a second time.
from swift-klib-plugin.
I get exactly the same problems, although mine is around the other way to your error message:
:0: warning: using sysroot for 'MacOSX' but targeting 'iPhone'
and I get problems such as:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System...
It wants to target MacOS and the suggested fixes (which they really aren't) do not change anything.
@markst did you find a solution?
from swift-klib-plugin.
Related Issues (13)
- Problems with imports HOT 13
- Invalid Manifest (xCode 15) HOT 1
- build fail HOT 4
- Unable to sync project on Linux host HOT 2
- Testing Locally
- CryptoSwift is not working. HOT 1
- getting error : could not build Objective-C module 'AVFoundation' error: fatalError HOT 2
- Cant't seem to build if the path of the KMM project has spaces
- Can't expose native type (CBManagerState).
- Add support for setting swift tools version HOT 2
- CVPixelBuffer not supported
- Unable to publish multiplatform library for iOS HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swift-klib-plugin.