Travis Reitter
01/19/2022, 6:00 PMembedAndSignAppleFrameworkForXcode
and followed the steps here but am getting:
Task 'embedAndSignAppleFrameworkForXcode' not found in project ':SharedCode'
Nicolas Picon
01/19/2022, 6:05 PMTravis Reitter
01/19/2022, 6:06 PMTravis Reitter
01/19/2022, 6:07 PMTravis Reitter
01/19/2022, 6:13 PMRick Clephas
01/19/2022, 10:18 PMbaseName
isn't set for the framework (had that issue recenlty)
• If you for example try to build an iOS app for an M1 simulator and your shared module doesn't have the iosSimulatorArm64
targetTravis Reitter
01/19/2022, 10:29 PMbaseName
and have a iosSimulatorArm64
target (this is on an M1) and I think I've gotten past this issue. My current issue now seems to be linking:
dyld[28834]: Library not loaded: @rpath/SharedCode.framework/SharedCode
Referenced from: /Users/treitter/Library/Developer/CoreSimulator/Devices/A5638492-9E3A-4766-B4D4-6827DF4DBAC8/data/Containers/Bundle/Application/CADE4DEF-489A-4E7F-B600-8CFAA803F19D/DoubleStrain <http://dev.app/DoubleStrain|dev.app/DoubleStrain> dev
Reason: tried: '/Users/treitter/Library/Developer/Xcode/DerivedData/DoubleStrain-csfvqjqyopvjufbkvgenmyhjexpz/Build/Products/Debug-iphonesimulator/SharedCode.framework/SharedCode' (no such file), '/Users/treitter/Library/Developer/Xcode/DerivedData/DoubleStrain-csfvqjqyopvjufbkvgenmyhjexpz/Build/Products/Debug-iphonesimulator/PackageFrameworks/SharedCode.framework/SharedCode' (no such file),
...
and it crashes. That seems like it would be an issue of the framework search paths not being set but I do have this:
$(SRCROOT)/../SharedCode/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)
though that doesn't seem to appear in the list of paths that show up above (even including the ones I left out)Rick Clephas
01/20/2022, 6:16 AMTravis Reitter
01/20/2022, 3:46 PM$(inherited) -framework SharedCode
. Xcode renders each of those 3 elements on separate lines but I hope that doesn't matter. I don't think it has in the pastTravis Reitter
01/20/2022, 4:02 PMRick Clephas
01/20/2022, 4:07 PMTravis Reitter
01/20/2022, 4:10 PMios
targets in my Gradle down to just:
iosSimulatorArm64("ios") {
binaries {
framework {
baseName = "SharedCode"
}
}
}
which works for now since I'm only building on an M1 Mac and running in the simulator.Travis Reitter
01/20/2022, 4:10 PMRick Clephas
01/20/2022, 4:14 PMval iosArm64 = iosArm64()
val iosX64 = iosX64()
val iosSimulatorArm64 = iosSimulatorArm64()
sourceSets {
val iosMain by creating
val iosTest by creating
listOf(iosArm64, iosX64, iosSimulatorArm64).forEach {
it.binaries {
framework {
baseName = "SharedCode"
}
}
getByName("${it.targetName}Main") {
dependsOn(iosMain)
}
getByName("${it.targetName}Test") {
dependsOn(iosTest)
}
}
}
Depending on the Xcode environment variables Kotlin will figure out which targets to build.Travis Reitter
01/20/2022, 4:57 PM