Skip to content

Conversation

@hanluOMH
Copy link
Contributor

@hanluOMH hanluOMH commented Nov 11, 2025

Resolved facenet can't compile problems in ios by add podfile

Resolved MissingResourceException for .pem certificate files on iOS by:

  • Updated composeApp.podspec to explicitly copy PEM files from src/commonMain/composeResources/files into the app bundle during build
  • Added hardcoded package name fallback for resource path resolution
  • Ensured compose resources are properly packaged in iosApp.app bundle

This version only works for iOS with ARM chips.

**Build steps for iOS:

Step 1 - Gradle preparation:
./gradlew :composeApp:clean
./gradlew :composeApp:generateDummyFramework
./gradlew :composeApp:prepareComposeResourcesTaskForCommonMain

Step 2 - CocoaPods:
pod install

Step 3 - Xcode build:

  1. Open iosApp.xcworkspace in Xcode
  2. Set up Team and Bundle Identifier in project settings
  3. Product → Clean Build Folder
  4. Product → Run**

@hanluOMH
Copy link
Contributor Author

hanluOMH commented Nov 11, 2025

Hi @TheBlackBit ,
Can you please test this fix on iOS (it only works on devices with ARM chips)?
The test steps are included above.

I’ve tested it and confirmed that it works — here’s the video: link.

Regarding the .pem file change — it’s a temporary modification. I believe the current code already has some problems to the .pem, which are tracked in this ticket to fix the problem.
Once you verify that the fix works, I’ll revert the .pem files and properly address the issue later. The .pem change in this PR is only to enable testing of the iOS fix for now.

Also if you find a better solution for this ios build problem , don't hestitate to share it :)

@TheBlackBit
Copy link
Contributor

TheBlackBit commented Nov 12, 2025

Hi @TheBlackBit , Can you please test this fix on iOS (it only works on devices with ARM chips)? The test steps are included above.

I’ve tested it and confirmed that it works — here’s the video: link.

Regarding the .pem file change — it’s a temporary modification. I believe the current code already has some problems to the .pem, which are tracked in this ticket to fix the problem. Once you verify that the fix works, I’ll revert the .pem files and properly address the issue later. The .pem change in this PR is only to enable testing of the iOS fix for now.

Also if you find a better solution for this ios build problem , don't hestitate to share it :)

Sure Hanlu

Copy link
Member

@VishnuSanal VishnuSanal left a comment

Choose a reason for hiding this comment

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

thanks Hanlu, please see the comments. also, is there any guide that we can link to in the documentatino for reference?

@hanluOMH hanluOMH force-pushed the vishu-facenet-ios branch 4 times, most recently from 6f42e50 to b3e851f Compare November 13, 2025 23:05
Resolved  facenet can't compile problems by add podfile

Resolved MissingResourceException for .pem certificate files on iOS by:
- Updated composeApp.podspec to explicitly copy PEM files from
  src/commonMain/composeResources/files into the app bundle during build
- Added hardcoded package name fallback for resource path resolution
- Ensured compose resources are properly packaged in iosApp.app bundle

This version only works for iOS with ARM chips.

Build steps for iOS:

Step 1 - Gradle preparation:
  ./gradlew :composeApp:clean
  ./gradlew :composeApp:generateDummyFramework
  ./gradlew :composeApp:prepareComposeResourcesTaskForCommonMain

Step 2 - CocoaPods:
  pod install

Step 3 - Xcode build:
  1. Open iosApp.xcworkspace in Xcode
  2. Set up Team and Bundle Identifier in project settings
  3. Product → Clean Build Folder
  4. Product → Run

minor change for ios build issues
@hanluOMH
Copy link
Contributor Author

hanluOMH commented Nov 13, 2025

Hi @koukarine, these are our changes to support facenet for iOS.

You can test it using the steps listed below:

Build steps for iOS:

  • Step 1 - Gradle preparation:
    • ./gradlew :composeApp:clean
    • ./gradlew :composeApp:generateDummyFramework
    • ./gradlew :composeApp:prepareComposeResourcesTaskForCommonMain
  • Step 2 - CocoaPods:
    • pod install
  • Step 3 - Xcode build:
    • Open `iosApp.xcworkspace in Xcode
    • Set up Team and Bundle Identifier in project settings
    • Product → Clean Build Folder
    • Product → Run

Please see this video for reference.

Feel free to add your suggestion, thanks a lot!

Copy link
Member

@VishnuSanal VishnuSanal left a comment

Choose a reason for hiding this comment

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

lgtm, thanks hanlu!

Copy link
Contributor

@TheBlackBit TheBlackBit left a comment

Choose a reason for hiding this comment

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

Works for me as well

Copy link

@koukarine koukarine left a comment

Choose a reason for hiding this comment

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

Looks good. I would just make sure the documentation is stating that it should be done on MAC workstation and that cocoapods might require the specific installation procedure to work with KMP (there are several guides available online for that).

Also, I'm a bit puzzled that the dedicated gradle task is required for the "Dummy framework" copying. I can't tell for sure, as the multipaz iOS setup was done without me, but I believe the Android Studio is taking care of cocoapods dependencies automatically in the KMP project when the Podfile is detected. However, your project structure might be different, and thus requiring that step.

@hanluOMH
Copy link
Contributor Author

**Build steps for iOS:

Step 1 - Gradle preparation: ./gradlew :composeApp:clean ./gradlew :composeApp:generateDummyFramework ./gradlew :composeApp:prepareComposeResourcesTaskForCommonMain

Step 2 - CocoaPods: pod install

Step 3 - Xcode build:

  1. Open iosApp.xcworkspace in Xcode
  2. Set up Team and Bundle Identifier in project settings
  3. Product → Clean Build Folder
  4. Product → Run**

Looks good. I would just make sure the documentation is stating that it should be done on MAC workstation and that cocoapods might require the specific installation procedure to work with KMP (there are several guides available online for that).

Also, I'm a bit puzzled that the dedicated gradle task is required for the "Dummy framework" copying. I can't tell for sure, as the multipaz iOS setup was done without me, but I believe the Android Studio is taking care of cocoapods dependencies automatically in the KMP project when the Podfile is detected. However, your project structure might be different, and thus requiring that step.

Thanks Alex for your feedback.
Yes, because use cocopod, so we need above steps to make the project works.

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.

4 participants