Skip to content

fix(ios): remove unsupported MediaPipe API calls for iOS build#236

Closed
dltkdgns00 wants to merge 1 commit into
DenisovAV:mainfrom
dltkdgns00:fix/ios-compile-error-unsupported-options
Closed

fix(ios): remove unsupported MediaPipe API calls for iOS build#236
dltkdgns00 wants to merge 1 commit into
DenisovAV:mainfrom
dltkdgns00:fix/ios-compile-error-unsupported-options

Conversation

@dltkdgns00
Copy link
Copy Markdown

@dltkdgns00 dltkdgns00 commented Apr 25, 2026

Description

The iOS MediaPipeTasksGenAI (0.10.33) SDK currently used in flutter_gemma does not yet support or expose the latest options (e.g., preferredBackend, enableAudioModality) that were added to the Android version. This causes Xcode compilation errors when these properties and methods (addAudio, cancelGenerateResponseAsync) are called in ios/Classes/InferenceModel.swift.

This PR temporarily comments out the unsupported API calls to fix the iOS build error.

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactoring
  • Test addition

Testing

  • Tested on Android
  • Tested on iOS
  • Tested on Web
  • Tested on Desktop (macOS/Windows)

Checklist

  • Code follows style guidelines
  • Self-review completed
  • Comments added for complex code
  • Documentation updated
  • No new warnings
  • Tests added/updated

@DenisovAV
Copy link
Copy Markdown
Owner

Thanks for the PR, but I can't merge this — these APIs do exist in MediaPipeTasksGenAI 0.10.33 and are actively used by the plugin.

I just verified against the actual .swiftinterface shipped in the pod:

public var preferredBackend: LlmInference.LlmPreferredBackend
public var enableAudioModality: Swift.Bool
public func addAudio(audio: Foundation.Data) throws
public func cancelGenerateResponseAsync() throws

iOS CI is green, GPU backend and audio modality work on real devices. Commenting these out would silently regress those features for everyone.

Most likely an older MediaPipe version got pulled into your local Pods. Please try:

  1. cd ios && rm -rf Pods Podfile.lock && pod install --repo-update
  2. Verify Podfile.lock shows MediaPipeTasksGenAI (= 0.10.33)
  3. Clean DerivedData: rm -rf ~/Library/Developer/Xcode/DerivedData/*
  4. flutter clean && flutter pub get and rebuild

If the build still fails after that, please open an issue with the full Xcode error log + your Podfile.lock and we'll dig in.

Closing this PR for now.

@DenisovAV
Copy link
Copy Markdown
Owner

Closing as discussed in the previous comment — these MediaPipe APIs (preferredBackend, enableAudioModality, addAudio, cancelGenerateResponseAsync) work as expected on MediaPipeTasksGenAI 0.10.33 and are actively used by the plugin (iOS Metal GPU + audio input on iPhone tested in 0.14.x and 0.15.x). The build failure was a Pod cache issue, not a missing API.

If a clean install (rm -rf ios/Pods ios/Podfile.lock && cd ios && pod install --repo-update followed by flutter clean && flutter pub get) still fails on 0.15.x, please open an issue with the full Xcode error log + your Podfile.lock.

@DenisovAV DenisovAV closed this May 10, 2026
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.

2 participants