Skip to content

Fix: iOS build failure on CI - #2654

Merged
niyajali merged 15 commits into
openMF:developmentfrom
itsPronay:ios-build-fix
Apr 1, 2026
Merged

Fix: iOS build failure on CI#2654
niyajali merged 15 commits into
openMF:developmentfrom
itsPronay:ios-build-fix

Conversation

@itsPronay

@itsPronay itsPronay commented Mar 18, 2026

Copy link
Copy Markdown
Member

Fixes - https://mifosforge.jira.com/browse/MIFOSAC-492

Summary by CodeRabbit

  • New Features

    • iOS now integrates CocoaPods (including Firebase) and adds a workspace to manage dependencies.
    • Build system: added Kotlin CocoaPods support and top-level plugin alias for CocoaPods.
  • Chores

    • Added a CocoaPods podspec for the shared framework with sync/build hooks and resource registration.
    • CI/release tooling: pinned Fastlane version, added CocoaPods gem support, and updated lanes to install pods and sanitize options.
    • Updated iOS versioning and locale handling for releases.
  • Bug Fixes

    • UI: Embedded view now ignores all safe-area edges.

@itsPronay
itsPronay requested a review from a team March 18, 2026 11:44
@itsPronay
itsPronay marked this pull request as draft March 18, 2026 11:44
@coderabbitai

coderabbitai Bot commented Mar 18, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ff8d9663-aa05-4676-b72f-ba8d99b30ead

📥 Commits

Reviewing files that changed from the base of the PR and between 9d40722 and f76a365.

📒 Files selected for processing (3)
  • build.gradle.kts
  • cmp-shared/build.gradle.kts
  • gradle/libs.versions.toml
✅ Files skipped from review due to trivial changes (1)
  • build.gradle.kts
🚧 Files skipped from review as they are similar to previous changes (2)
  • gradle/libs.versions.toml
  • cmp-shared/build.gradle.kts

📝 Walkthrough

Walkthrough

Adds 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

Cohort / File(s) Summary
Kotlin/Gradle Cocoapods
cmp-shared/build.gradle.kts, gradle/libs.versions.toml, build.gradle.kts
Enable Kotlin Cocoapods plugin via plugin alias and add cocoapods { ... } block in cmp-shared (pod metadata, iOS target 16.0, Podfile path, framework baseName/isStatic). Top-level plugins file registers alias.
CocoaPods artifacts
cmp-shared/cmp_shared.podspec, cmp-ios/Podfile
New podspec publishing vendored ComposeApp.framework with pre-build script that invokes Gradle :cmp-shared:syncFramework (skippable via override), sets xcconfig/pod_target_xcconfig, registers resources; new Podfile referencing local cmp_shared, Firebase pods, iOS target, and a post_install hook that disables code signing and bumps deployment target to ≥12.0 for pods.
iOS Xcode project/workspace
cmp-ios/iosApp.xcodeproj/project.pbxproj, cmp-ios/iosApp.xcworkspace/contents.xcworkspacedata
Added CocoaPods workspace/project references, Pods group, Pods-generated .xcconfig references for build configurations, Pods framework file reference, and CocoaPods run script build phases (Check Pods Manifest.lock, Embed Pods Frameworks, Copy Pods Resources). Removed empty package references.
iOS app UI change
cmp-ios/iosApp/ContentView.swift
Updated embedded ComposeView to use .ignoresSafeArea(edges: .all) (previously .ignoresSafeArea(.keyboard)).
Ruby tooling
Gemfile
Pin fastlane to 2.232.2, add Ruby stdlib compatibility gems (abbrev, base64, mutex_m, bigdecimal) and cocoapods, "~> 1.16".
Fastlane automation
fastlane/FastFile
Added sanitize_options(options) helper to strip empty-string keys; run cocoapods(podfile: "cmp-ios/Podfile", try_repo_update_on_error: true) in iOS lanes; revised version bump logic comparing against latest TestFlight version and bumping patch if needed; use configured primary locale for localized metadata and pass app_rating_config_path to deliver.

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)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I hopped through pods and Gradle trails,
A tiny framework tucked in bundles and sails,
Fastlane trims options, CocoaPods aligns,
Xcode and workspace stitch their lines,
Hooray — builds hop onward, release in sight! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix: iOS build failure on CI' clearly describes the primary objective of the changeset, which adds CocoaPods integration and iOS build infrastructure to resolve CI build failures.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 120053a and cef739e.

📒 Files selected for processing (2)
  • cmp-ios/iosApp.xcodeproj/project.xcworkspace/xcuserdata/pronaysarker.xcuserdatad/UserInterfaceState.xcuserstate
  • cmp-shared/build.gradle.kts

Comment thread cmp-shared/build.gradle.kts Outdated
@itsPronay
itsPronay marked this pull request as ready for review March 20, 2026 18:33
@itsPronay itsPronay changed the title test ios build Fix: iOS build failure on cli Mar 20, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.kts already derives the CocoaPods version from project.version, but this podspec is pinned to 2025.10.5. The next version bump will leave the pod metadata out of sync with the framework build configuration and lockfile history. Prefer sourcing spec.version from 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

📥 Commits

Reviewing files that changed from the base of the PR and between cef739e and 9d40722.

⛔ Files ignored due to path filters (1)
  • Gemfile.lock is excluded by !**/*.lock
📒 Files selected for processing (10)
  • Gemfile
  • cmp-ios/Podfile
  • cmp-ios/iosApp.xcodeproj/project.pbxproj
  • cmp-ios/iosApp.xcodeproj/project.xcworkspace/xcuserdata/pronaysarker.xcuserdatad/UserInterfaceState.xcuserstate
  • cmp-ios/iosApp.xcworkspace/contents.xcworkspacedata
  • cmp-ios/iosApp/ContentView.swift
  • cmp-shared/build.gradle.kts
  • cmp-shared/cmp_shared.podspec
  • fastlane/FastFile
  • gradle/libs.versions.toml
✅ Files skipped from review due to trivial changes (1)
  • cmp-ios/iosApp.xcworkspace/contents.xcworkspacedata

Comment thread cmp-ios/iosApp.xcodeproj/project.pbxproj
Comment thread cmp-ios/Podfile
Comment thread fastlane/FastFile
Comment thread fastlane/FastFile
@niyajali

Copy link
Copy Markdown
Collaborator

@itsPronay can you fix the web build issue too

@niyajali niyajali changed the title Fix: iOS build failure on cli Fix: iOS build failure on CI Mar 23, 2026
@itsPronay

itsPronay commented Mar 23, 2026

Copy link
Copy Markdown
Member Author

@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.
Lets see what bhaiya says on today's standup about that. If it gets assigned to me, I’ll go ahead and fix it.

Edit: I was wrong, Confirmed with Revant. arin has picked up the ticket and he is working on it

Comment thread cmp-shared/build.gradle.kts Outdated
@niyajali

niyajali commented Apr 1, 2026

Copy link
Copy Markdown
Collaborator

@itsPronay let me know when all checks are passed except the web one

@niyajali
niyajali enabled auto-merge (squash) April 1, 2026 15:26
@sonarqubecloud

sonarqubecloud Bot commented Apr 1, 2026

Copy link
Copy Markdown

@biplab1 biplab1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. This can be merged.

@biplab1

biplab1 commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

@itsPronay Please review and mark the conversations as resolved so it can auto-merge after PR checks are successful.

@niyajali
niyajali merged commit 8c7d2bf into openMF:development Apr 1, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants