Skip to content

Solana.Swift v2.0.2 Build Failures: RawSpan doesn't conform to Sequence protocol on iOS 18.5/Xcode 26.0 #234

@damianotomasso-collab

Description

@damianotomasso-collab

I'm experiencing build failures when integrating Solana.Swift v2.0.2 into my iOS project targeting iOS 18.5 with Xcode 26.0. The build fails with multiple errors related to RawSpan not conforming to the Sequence protocol.

🔍 Specific Errors

error: 'RawSpan' does not conform to 'Sequence' protocol
error: 'RawSpan' has no member 'toHexString'
error: 'RawSpan' has no member 'count'
error: Cannot convert 'RawSpan' to '[UInt8]'
error: Cannot convert 'RawSpan?' to '[UInt8]?'

�� Environment Details

  • Xcode Version: 26.0 (Build 17A324)
  • iOS Target: 18.5
  • Solana.Swift Version: 2.0.2
  • Repository Used: metaplex-foundation/Solana.Swift.git
  • Branch/Commit: master (bc2e7e5)
  • Device: iPhone 17 Simulator
  • Swift Version: 5

🔄 Steps to Reproduce

  1. Create new iOS project with iOS 18.5 target
  2. Add Solana.Swift package dependency:
    dependencies: [
        .package(url: "https://github.com/metaplex-foundation/Solana.Swift.git", branch: "master")
    ]
  3. Import Solana in any Swift file:
    import Solana
  4. Attempt to build the project
  5. Build fails with RawSpan-related errors

📋 Affected Files

Based on build logs, errors occur in:

  • Array+Extension.swift (line 78)
  • Data+Extension.swift (line 19)
  • PublicKey+AssociatedTokenProgram.swift (lines 51, 87)
  • String+Extension.swift (line 6)

🛠️ Current Workaround

I've temporarily resolved this by:

  1. Commenting out Solana SDK in project dependencies
  2. Using a mock implementation for development
  3. Documenting the issue for future resolution

❓ Questions for Community

  1. Is this a known issue with iOS 18.5/Xcode 26.0 compatibility?
  2. Are there any patches or forks that resolve these RawSpan issues?
  3. Is there a timeline for official fixes?
  4. Are there alternative Solana Swift SDKs that work with current iOS versions?
  5. What's the recommended approach for production apps that need Solana functionality?

🔗 Related Context

This appears to be related to changes in Swift's type system and protocol conformance requirements in newer iOS/Xcode versions. The RawSpan type seems to have compatibility issues with current Swift standards.

📊 Impact

This prevents integration of Solana functionality into iOS apps targeting current iOS versions, affecting:

  • Wallet integration
  • Token transfers
  • DApp connectivity
  • DeFi applications

Any guidance, workarounds, or updates would be greatly appreciated! ��
Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

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