Creating a static library on Kotlin Native crashes with "have the same architectures (arm64) and can't be in the same fat output file"
See original GitHub issueproject: https://github.com/realm/realm-kotlin-samples/tree/main/Intro
I want to package it as a static library instead of dynamic, so I add the following in build.gradle.kts
targets.withType<org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget> {
// use static
binaries.withType<org.jetbrains.kotlin.gradle.plugin.mpp.Framework> {
isStatic = true
}
}
task:
./gradlew assemble
failed:
folder:
I guess that the executable file generated in the iosX64 folder contains the arm64 architecture, so the execution of linkDebugFrameworkIosFat fails.
The error is as follows
have the same architectures (arm64) and can't be in the same fat output file
Please reply as soon as possible, I need your help!
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9
Top Results From Across the Web
Build final native binaries - Kotlin
In this case, you can use the resulting universal framework on both 32-bit and 64-bit devices. The fat framework must have the same...
Read more >iOS app with framework crashed on device, dyld: Library not ...
I have tried to build on iOS 7.1 and 8.0 devices, they both have the same crash. However, I can build an app...
Read more >react-native/CHANGELOG.md at main - GitHub
A framework for building native applications using React ... Bugfix for multiple shadow threads rendered at the same time, small probability crash.
Read more >Java Development on an Apple M1 (ARM64) - rieckpil
Rule one: Whenever there's a native arm64 build of any development ... (fat file, but missing compatible architecture (have 'i386,x86_64', ...
Read more >Ask HN: How are you dealing with the M1/ARM migration?
You can build multiplatform images for x86 and ARM (e.g. M1 Mac) like so: docker buildx build --platform linux/amd64,linux/arm64 . I constantly use...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I use your official Demo. https://github.com/realm/realm-kotlin-samples/tree/main/Intro just add as below:
I didn’t change any Xcode buildSettings,just run
./gradlew assemble
I also tried to modify it according to the link you gave, but it didn’t work either. I try to use sqldelight, and then package the static library, it works fine.
You can use your own official Demo to compile it into a static library,maybe my settings are wrong.
Looking forward to your reply. @cmelchior
Great! It works fine. 👏 👏 👏