Jason
01/14/2025, 12:18 AM./gradlew :shared:embedAndSignAppleFrameworkForXcode
but the error on CI build server shows 2 errors: (I already added KOTLIN_FRAMEWORK_BUILD_TYPE btw, same error)
* What went wrong:
Execution failed for task ':shared:embedAndSignAppleFrameworkForXcode'.
> Unable to detect Kotlin framework build type for CONFIGURATION=QA automatically. Specify 'KOTLIN_FRAMEWORK_BUILD_TYPE' to 'debug' or 'release'
1 problem was found storing the configuration cache.
`- Task :shared:embedAndSignAppleFrameworkForXcode
of type `org.gradle.api.DefaultTask`: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not supported with the configuration cache.`
See <https://docs.gradle.org/8.9/userguide/configuration_cache.html#config_cache:requirements:disallowed_types>
Do you have to have this build phase run as a separate Gradle Task or as long as gradlew is available in the repo it should work just like a local build?chrisjenx
01/14/2025, 1:43 AMJason
01/14/2025, 2:57 AMScott Lanoue
01/14/2025, 10:14 PM--no-configuration-cache
I had to do the same when using a github actions macos runner to sign and publish a KMP library
https://github.com/schott12521/compose-cupertino/blob/main/.github/workflows/buildAndPush.yml#L79C32-L79C56Scott Lanoue
01/14/2025, 10:14 PMDaniele Segato
01/30/2025, 7:01 AMJason
01/30/2025, 7:03 PMembedAndSignAppleFrameworkForXcode
gradle task. I had added KOTLIN_FRAMEWORK_BUILD_TYPE
user defined build setting and set the appropriate value for each configuration. For CI, I am using exact same gradle task now as it uses xcodebuild and both CI and local builds work exactly the same. I did not have to disable gradle configuration cache either, I think that error was caused by the first error which is now resolved. If you post your error here, I may be able to help you out. If your using direct framework linking like I am, make sure the builds phase on your target which invokes this gradlew task is above Compile phase, so the iOS Shared Framework is built and linked to the project prior to compiling any other code that depends on it.Daniele Segato
01/30/2025, 7:08 PMDaniele Segato
01/31/2025, 3:13 PM> Task :shared:common:multiplatform:embedAndSignAppleFrameworkForXcode FAILED
* What went wrong:
Execution failed for task ':shared:common:multiplatform:embedAndSignAppleFrameworkForXcode'.
> Unable to detect Kotlin framework build type for CONFIGURATION=Development automatically. Specify 'KOTLIN_FRAMEWORK_BUILD_TYPE' to 'debug' or 'release'
XcodeEnvironment:
buildType=null
targets=[ios_simulator_arm64]
frameworkSearchDir=Development/iphonesimulator18.0
builtProductDir=/Users/username/Library/Developer/Xcode/DerivedData/ProjectName-ios-gtbmmzdloluwhwbyqnlxrmxnbdhz/Build/Products/Development-iphonesimulator
embeddedFrameworksDir=/Users/username/Library/Developer/Xcode/DerivedData/ProjectName-ios-gtbmmzdloluwhwbyqnlxrmxnbdhz/Build/Products/Development-iphonesimulator/Vivisol-it.app/Frameworks
sign=-
userScriptSandboxingEnabled=false
Daniele Segato
01/31/2025, 3:14 PMJason
01/31/2025, 6:57 PMembedAndSignAppleFrameworkForXcode
gradle task will read the value from that setting when it executes. Sounds like you did that. Sometimes autocompletion is slow in Xcode for KMP types you have exported, mine sometimes also doesn't work, its possibly a caching issue which re-indexing may help with. But in general Xcode Auto-completion has always been a hit or miss for me, even before I started using KMP.Daniele Segato
01/31/2025, 7:18 PM