Skip to content

[iOS] Multiple build errors with Capacitor 8 SPM - API incompatibility #2461

@plainsquirrel

Description

@plainsquirrel

Bug Report

Capacitor Version

@capacitor/core: 8.0.0 @capacitor/ios: 8.0.0 @capacitor-community/safe-area: 8.0.1 capacitor-swift-pm: 8.0.0

Platform

iOS (Swift Package Manager)

Current Behavior

When building an iOS app with Capacitor 8 using Swift Package Manager (SPM), the build fails with multiple errors:

SafeAreaPlugin.swift:20:51: error: value of type 'PluginConfig' has no member 'getString' SafeAreaPlugin.swift:48:43: error: missing argument for parameter #2 in call SafeAreaPlugin.swift:49:41: error: missing argument for parameter #2 in call SafeAreaPlugin.swift:82:41: error: missing argument for parameter #2 in call SafeAreaPlugin.swift:92:41: error: missing argument for parameter #2 in call SafeAreaPlugin.swift:108:25: error: value of type 'any CAPBridgeProtocol' has no member 'viewController' SafeAreaPlugin.swift:118:21: error: value of type 'any CAPBridgeProtocol' has no member 'viewController' SafeAreaPlugin.swift:125:39: error: value of type 'CAPBridgeViewController' has no member 'bridge'

Expected Behavior

The project should compile successfully with Capacitor 8 SPM.

Steps to Reproduce

  1. Create a new Capacitor 8 project
  2. Install @capacitor-community/[email protected]
  3. Run npx cap sync ios
  4. Build iOS project with Xcode

Additional Context

The Capacitor 8 SPM xcframework appears to have different API signatures compared to what the plugin code expects:

  1. PluginConfig.getString() - method not available
  2. CAPPluginCall.getString() - requires additional parameter
  3. CAPBridgeProtocol.viewController - property not available
  4. CAPBridgeViewController.bridge - property not available

This suggests the plugin needs to be updated to match the new Capacitor 8 SPM API.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions