Fix: iOS build failure on CI - #2654
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds CocoaPods support and integration for the KMP iOS module (Podfile, podspec, workspace/project), wires Kotlin Cocoapods plugin and podspec Gradle hooks, pins Ruby gems including CocoaPods, updates Fastlane to sanitize options and run pod install, and tweaks a SwiftUI view safe-area setting. Changes
Sequence Diagram(s)sequenceDiagram
rect rgba(200,230,255,0.5)
participant Dev as Developer/CI
participant Gradle as Gradle (KMP)
participant CocoaPods as CocoaPods
participant Xcode as Xcode
participant Fastlane as Fastlane
end
Dev->>Gradle: build / generate ComposeApp.framework (syncFramework)
Gradle-->>Dev: framework at build/cocoapods/framework/ComposeApp.framework
Dev->>CocoaPods: pod install using `cmp-ios/Podfile`
CocoaPods->>CocoaPods: run podspec `script_phases` -> may invoke Gradle syncFramework
CocoaPods-->>Dev: pods integrated, workspace updated (Pods.xcodeproj)
Fastlane->>CocoaPods: cocoapods(podfile: "cmp-ios/Podfile")
Fastlane->>Xcode: build/archive/export and deliver (uses sanitized options & bumped version)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@cmp-shared/build.gradle.kts`:
- Around line 72-78: The current logic building linkTaskName and calling
tasks.findByName(...) misses Kotlin/Native's actual task naming (e.g.,
linkDebugFrameworkIosArm64) and therefore never wires dependencies; update the
block that references generateDummyFramework to instead query
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinNativeLink::class.java),
filter those link tasks where the output kind is a FRAMEWORK and the task’s
konanTarget or name matches the iOS target (use target.name or
target.konanTarget), and then configure generateDummyFramework to dependOn each
matching KotlinNativeLink task; reference generateDummyFramework and
KotlinNativeLink when making the dependency so framework linking tasks are
correctly discovered and wired.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ac8883d2-d0d0-40c7-beaa-701b7bff7b19
📒 Files selected for processing (2)
cmp-ios/iosApp.xcodeproj/project.xcworkspace/xcuserdata/pronaysarker.xcuserdatad/UserInterfaceState.xcuserstatecmp-shared/build.gradle.kts
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
cmp-shared/cmp_shared.podspec (1)
2-4: Keep the podspec version sourced from the same place as Gradle.
cmp-shared/build.gradle.ktsalready derives the CocoaPods version fromproject.version, but this podspec is pinned to2025.10.5. The next version bump will leave the pod metadata out of sync with the framework build configuration and lockfile history. Prefer sourcingspec.versionfrom the same sanitized value, or generate the podspec from Gradle.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@cmp-shared/cmp_shared.podspec` around lines 2 - 4, The podspec currently hardcodes spec.version = '2025.10.5', which will diverge from the Gradle-derived CocoaPods version; remove the hardcoded spec.version and instead have the podspec populated from the same sanitized project.version used in your Gradle build (the logic in cmp-shared/build.gradle.kts that derives the CocoaPods version). Implement this by either templating/generating cmp_shared.podspec from Gradle (create a Gradle task that writes spec.version with the sanitized project.version) or by replacing the literal with a placeholder and injecting the sanitized project.version at build time so spec.version always matches project.version.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@cmp-ios/iosApp.xcodeproj/project.pbxproj`:
- Around line 114-120: Remove the legacy direct-KMP build phase entry named
"Compile Kotlin Framework" (UUID F36B1CEB2AD83DDC00CB74D5) from the Xcode target
buildPhases so the shared module is only built via the pod-injected script phase
from cmp-shared/cmp_shared.podspec (the :cmp-shared:syncFramework pod target
script). Ensure you delete the "Compile Kotlin Framework" build phase object and
remove its reference from any buildPhases arrays to avoid duplicate framework
builds and stale-artifact resolution.
In `@cmp-ios/Podfile`:
- Around line 1-3: The Podfile raises the pods to iOS 16.0 but the host app
target in iosApp.xcodeproj still uses 15.3; update the iosApp target deployment
target to 16.0 for all configurations to match. Open the Xcode project file
(iosApp.xcodeproj/project.pbxproj) and change the IPHONEOS_DEPLOYMENT_TARGET for
the iosApp target configurations (Debug and Release) to "16.0" so the iosApp
target and the cmp_shared framework share the same minimum iOS version and avoid
link/archive failures.
In `@fastlane/FastFile`:
- Around line 450-454: The CocoaPods step calls cocoapods(...) before the dummy
ComposeApp.framework is created, causing pod install to abort; before each
cocoapods(...) invocation (the ones around cocoapods in FastFile and the other
lanes at the ranges you noted) call the Gradle task
:cmp-shared:generateDummyFramework once to bootstrap the framework, and factor
that call into a shared helper lane (e.g., bootstrap_cocoapods_dummy_framework)
that all affected lanes invoke prior to cocoapods(...). Update the lanes that
reference cocoapods (including the blocks at ~450, ~470, ~551, ~677) to call the
new helper instead of running cocoapods directly so a clean CI checkout
succeeds.
- Around line 614-620: The code reads locale from ios_config[:primary_locale]
(BUILD_CONFIG[:primary_locale]) and then builds localized_build_info, but
primary_locale can be nil which causes pilot/release path composition to fail;
ensure you provide a fallback when assigning locale (e.g. use
ios_config[:primary_locale] with a default like "en-US") and apply the same
fallback in the other occurrence that builds localized_build_info so the locale
key is never nil before calling pilot/release metadata path logic.
---
Nitpick comments:
In `@cmp-shared/cmp_shared.podspec`:
- Around line 2-4: The podspec currently hardcodes spec.version = '2025.10.5',
which will diverge from the Gradle-derived CocoaPods version; remove the
hardcoded spec.version and instead have the podspec populated from the same
sanitized project.version used in your Gradle build (the logic in
cmp-shared/build.gradle.kts that derives the CocoaPods version). Implement this
by either templating/generating cmp_shared.podspec from Gradle (create a Gradle
task that writes spec.version with the sanitized project.version) or by
replacing the literal with a placeholder and injecting the sanitized
project.version at build time so spec.version always matches project.version.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 4f5976c8-b355-47c6-a9b3-98f2681f883f
⛔ Files ignored due to path filters (1)
Gemfile.lockis excluded by!**/*.lock
📒 Files selected for processing (10)
Gemfilecmp-ios/Podfilecmp-ios/iosApp.xcodeproj/project.pbxprojcmp-ios/iosApp.xcodeproj/project.xcworkspace/xcuserdata/pronaysarker.xcuserdatad/UserInterfaceState.xcuserstatecmp-ios/iosApp.xcworkspace/contents.xcworkspacedatacmp-ios/iosApp/ContentView.swiftcmp-shared/build.gradle.ktscmp-shared/cmp_shared.podspecfastlane/FastFilegradle/libs.versions.toml
✅ Files skipped from review due to trivial changes (1)
- cmp-ios/iosApp.xcworkspace/contents.xcworkspacedata
|
@itsPronay can you fix the web build issue too |
@niyajali , @therajanmaurya mentioned during Wednesday’s standup that he might take care of it. Maybe he already started working on it. Edit: I was wrong, Confirmed with Revant. arin has picked up the ticket and he is working on it |
|
@itsPronay let me know when all checks are passed except the web one |
|
biplab1
left a comment
There was a problem hiding this comment.
Looks good to me. This can be merged.
|
@itsPronay Please review and mark the conversations as resolved so it can auto-merge after PR checks are successful. |



Fixes - https://mifosforge.jira.com/browse/MIFOSAC-492
Summary by CodeRabbit
New Features
Chores
Bug Fixes