Skip to content

build(ios): Swift compilation errors with Capacitor 8.0.2 in GeolocationCallbackManager.swift #77

@H40831

Description

@H40831

Bug Report

Plugin(s)

@capacitor/geolocation 8.0.0

Capacitor Version

  • Capacitor Core: 8.0.2
  • Capacitor iOS: 8.0.2

Platform(s)

iOS (Xcode 15.4, iPhone SDK 17.5)

Current Behavior

After upgrading to Capacitor 8.0.2 and @capacitor/geolocation 8.0.0, the iOS project fails to compile in Xcode with the following Swift errors:

Expected Behavior

The project should compile successfully on iOS with Capacitor 8.x.

Code Reproduction

This occurs in a standard Capacitor 8 environment when adding the @capacitor/geolocation plugin and syncing to iOS.

Other Technical Details

  • macOS Sonoma (darwin 23.4.0)
  • Swift 5

Additional Context

Important

Technical Disclaimer:
I am reporting this issue based on an AI-assisted investigation. Since I am not an expert in Capacitor's internal Swift architecture, I will not be able to provide further technical details or respond to follow-up questions. Please refer to the analysis below.

Root Cause Analysis (AI generated):
The errors are caused by breaking changes in the Capacitor 8 Swift API:

  1. saveCall signature change: bridge.saveCall(call) now requires a second argument plugin: CAPBridgedPlugin.
  2. CAPPluginCall method change: The reject method has been removed or modified in the new version, and should be replaced with error().

Suggested Fix:

  • Update GeolocationCallbackManager.swift to accept a reference to the plugin and use bridge?.saveCall(call, plugin: self.plugin).
  • Replace call.reject(message, code) with call.error(message, code).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions