Hi,
when I try to build my app for iOS with this as a dependency the build fails with the following error:
Showing Recent Issues
Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the iosApp editor.
Ld /Users/moritz/Library/Developer/Xcode/DerivedData/iosApp-gfbujjgcrbxffubzfovqsagohwuo/Build/Products/Debug-iphonesimulator/iosApp.app/iosApp normal (in target 'iosApp' from project 'iosApp')
cd /Users/moritz/AndroidStudioProjects/TestProject/iosApp
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target arm64-apple-ios14.1-simulator -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.2.sdk -L/Users/moritz/Library/Developer/Xcode/DerivedData/iosApp-gfbujjgcrbxffubzfovqsagohwuo/Build/Products/Debug-iphonesimulator -F/Users/moritz/Library/Developer/Xcode/DerivedData/iosApp-gfbujjgcrbxffubzfovqsagohwuo/Build/Products/Debug-iphonesimulator -F/Users/moritz/AndroidStudioProjects/TestProject/iosApp/Pods/../../shared/build/cocoapods/framework -F/Users/moritz/AndroidStudioProjects/TestProject/iosApp/Pods/webrtc-kmp/framework -F/Users/moritz/Library/Developer/Xcode/DerivedData/iosApp-gfbujjgcrbxffubzfovqsagohwuo/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/webrtc-kmp -filelist /Users/moritz/Library/Developer/Xcode/DerivedData/iosApp-gfbujjgcrbxffubzfovqsagohwuo/Build/Intermediates.noindex/iosApp.build/Debug-iphonesimulator/iosApp.build/Objects-normal/arm64/iosApp.LinkFileList -Xlinker -rpath -Xlinker /usr/lib/swift -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/moritz/Library/Developer/Xcode/DerivedData/iosApp-gfbujjgcrbxffubzfovqsagohwuo/Build/Intermediates.noindex/iosApp.build/Debug-iphonesimulator/iosApp.build/Objects-normal/arm64/iosApp_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -L/usr/lib/swift -Xlinker -add_ast_path -Xlinker /Users/moritz/Library/Developer/Xcode/DerivedData/iosApp-gfbujjgcrbxffubzfovqsagohwuo/Build/Intermediates.noindex/iosApp.build/Debug-iphonesimulator/iosApp.build/Objects-normal/arm64/iosApp.swiftmodule -ObjC -lc -lc++ -lsqlite3 -lstdc++ -framework AVFoundation -framework AudioToolbox -framework CoreAudio -framework CoreGraphics -framework CoreVideo -framework GLKit -framework VideoToolbox -framework WebRTC -framework shared -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/moritz/Library/Developer/Xcode/DerivedData/iosApp-gfbujjgcrbxffubzfovqsagohwuo/Build/Intermediates.noindex/iosApp.build/Debug-iphonesimulator/iosApp.build/iosApp.app-Simulated.xcent -framework Pods_iosApp -Xlinker -no_adhoc_codesign -Xlinker -dependency_info -Xlinker /Users/moritz/Library/Developer/Xcode/DerivedData/iosApp-gfbujjgcrbxffubzfovqsagohwuo/Build/Intermediates.noindex/iosApp.build/Debug-iphonesimulator/iosApp.build/Objects-normal/arm64/iosApp_dependency_info.dat -o /Users/moritz/Library/Developer/Xcode/DerivedData/iosApp-gfbujjgcrbxffubzfovqsagohwuo/Build/Products/Debug-iphonesimulator/iosApp.app/iosApp
ld: warning: ignoring file /Users/moritz/Library/Developer/Xcode/DerivedData/iosApp-gfbujjgcrbxffubzfovqsagohwuo/Build/Products/Debug-iphonesimulator/WebRTC.framework/WebRTC, missing required architecture arm64 in file /Users/moritz/Library/Developer/Xcode/DerivedData/iosApp-gfbujjgcrbxffubzfovqsagohwuo/Build/Products/Debug-iphonesimulator/WebRTC.framework/WebRTC (1 slices)
ld: in /Users/moritz/AndroidStudioProjects/TestProject/shared/build/cocoapods/framework/shared.framework/shared(dummy_vers.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/moritz/AndroidStudioProjects/TestProject/shared/build/cocoapods/framework/shared.framework/shared' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am quite sure I have set everything up correctly.
This is my podfile:
target 'iosApp' do
use_frameworks!
platform :ios, '14.1'
pod 'shared', :path => '../shared'
pod 'webrtc-kmp', :git => '[email protected]:shepeliev/webrtc-kmp.git', :tag => 'v0.89.6'
end
This is my shared build.gradle:
plugins {
kotlin("multiplatform")
kotlin("native.cocoapods")
id("com.android.library")
}
version = "1.0"
kotlin {
android()
iosX64()
iosArm64()
iosSimulatorArm64()
jvm()
cocoapods {
summary = "Some description for the Shared Module"
homepage = "Link to the Shared Module homepage"
ios.deploymentTarget = "14.1"
podfile = project.file("../iosApp/Podfile")
framework {
baseName = "shared"
}
}
ios {
binaries
.filterIsInstance<org.jetbrains.kotlin.gradle.plugin.mpp.Framework>()
.forEach {
it.transitiveExport = true
it.export("com.shepeliev:webrtc-kmp:0.89.6")
}
}
sourceSets {
val commonMain by getting
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
val clientMain by creating
val clientTest by creating
val androidMain by getting {
dependsOn(clientMain)
dependencies {
api("com.shepeliev:webrtc-kmp:0.89.6")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0-native-mt")
}
}
val androidTest by getting {
dependsOn(clientTest)
}
val iosMain by getting
val iosTest by getting
val jvmMain by getting
val jvmTest by getting
}
}
android {
compileSdk = 32
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
minSdk = 21
targetSdk = 32
}
}
I have made sure that I am opening the .xcworkspace file instead of the .xcodeproj one. I have also tried these two commands in the iosApp
directory:
pod deintegrate
pod install
They ran successfully.
From the error message I am assuming this could be because I am using a mac with an M1 chip. What do you think?