Skip to content

Fix Compilation errors in multiple-target/static framework projects by defining static library type #11

Description

@Lrey94

Please fill out as much known and relevant information as possible.

Version Information:

Hi NGA Team,

When attempting to integrate the MGRS Swift Package into an iOS project that utilises an internal static framework layer alongside a main application host and test runners, Xcode encounters critical linking errors (e.g., duplicate symbol errors during test target compilation or Library not found errors due to dynamic vs. static compilation mismatches).

Because the library type is currently left unspecified in Package.swift, the SPM toolchain defaults to dynamic behaviour or creates duplicate static object graph allocations depending on the consumer's target graph structure.

Explicitly declaring the package product as a static library resolves these complex dependency graph collisions for complex modular iOS projects.

Suggested Fix in the mgrs-ios Package.Swift:

products: [
    .library(
        name: "MGRS",
        type: .static, // Proposed fix - make static
        targets: ["MGRS"])
],

Test Files:

  • Links to any files needed for testing?

Additional Information:

  • Any additional configuration, data, or information that might help with the issue?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions